# Keyboard scan codes (Logitech's iNav Wheel)

## metalhedd

I just bought a logitech internet navigator Keyboard.. its a very nice keyboard and thanks to the wonderful developers of lineak (http://lineak.sourceforge.net) all of my fancy buttons work... however one thing has me really confused and somewhat baffled.  the meyboard has a scroll wheel which appeared to send just up and down arrow keys. so it scrolled in things like konqueror, however more slowly than the mouse wheel does.  logitech's iTouch software for windows will allow this scroll wheel to perform quite a fwe different functions under windows.  such as switching through your currently open programs.  zoom in and out in MS Office documents. and a few other fancy things.  so I Had to assume that the scancodes being sent were actually different than the up and down arrows.  but i ran xev and checked it out, pressing the down arrow and scrolling down on the wheel return the exact same scancode... How can windows recognize the difference? is it possible?  I emailed logitech customer support to inquire but haven't gotten a reply yet.  any ideas on how i can detect the difference under linux?

----------

## pjp

I'm just guessing, but perhaps the section of /etc/X11/XF86Config that looks similar to this:

```
# **********************************************************************

# Core Pointer's InputDevice section

# **********************************************************************

Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "IMPS/2"

    Option "Device"      "/dev/mouse"

    Option "ZAxisMapping" "4 5"
```

Those are my settings for a Logitech 2 button optical USB mouse (running through a PS/2 connector)

----------

## metalhedd

Thats all fine and dandy but i'm referring to a keyboard not a mouse... its an actual scrollwheel mounted on my keyboard... but it functions differently... (Like upand down arrows)

----------

## pjp

 :Laughing:  OK... for some reason, I thought you were trying to get 'extra' mouse buttons to work a certain way.

Ignore my last post, nothing to see there  :Very Happy: 

----------

## pjp

To somewhat makeup for that error, I found this. The key part is: *Quote:*   

> # Layout of your keyboard
> 
>     * Generic 101-key PC
> 
>     * Generic 102-key (Intl) PC
> ...

 

Is your keboard set to be recognized as the Logitech Internet Navigator Keyboard?  

If not, perhaps that will fix it.  I'm not sure how to change the keyboard type after install though.

----------

## Sequentious

Does lineak have any advantages over ~/.Xmodmap ?

----------

## metalhedd

actually I've decided to go with hotkeys instead.  It doesn't have my exact model but I can still get everything working by adding userdef tags  thats for that post on the keyboard type selection, I just did a reinstall and unfortunately i must have missed it again (unless its an option in KDE or X which haven't finished emerging yet.  i found both progerams to be a little unstable, and lineaks config program isn't very nice at all, i just edited the files manually.  the only major bonus of hotkeys is that I get a nice OSD.  :Smile: 

I haven't used ~/.Xmodmap  not sure how it works... I'll take a look at the a little more, maybe it will give me even more functionality, as it stands i really like the setup.

----------

## Sequentious

Heres the contents of my ~/.Xmodmap file

```
keycode 160=F20

keycode 174=F21

keycode 176=F22

keycode 162=F23

keycode 164=F24

keycode 144=F25

keycode 153=F26

keycode 229=F27

keycode 230=F28

keycode 236=F29 F30

keycode 178=F31

keycode 223=F32 F33
```

basically you use 'xev' to find the keycode, then map it to something. I chose Fxx keys that dont exist on my keyboard starting at 20 (this is fairly common ive heard). Then in sawfish, i mapped them to commands such as 'xmms --play-pause', or to launch mozilla, or whatever the button is supposed to do.

Strangely they seem to get recognized by X now (before they didnt), but they return keys like XAudioPlay, etc. Still works, though - and its a builtin feature of Xfree, so you dont need an extra program.

The tutorial i read was actually on the mandrake website, in the online docs area with tutorials, but its general linux stuff mostly.

EDIT: The keys where two keys are specified are supposed to be regular (first) and modified (second) by alt, or mod1, or something. but apparently that is irrelavent now that they keys are recognized as XAudioPlay, etc.

----------

