[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

See my cool Logitech InternetKeyboard Configuration for XFree4.1 :)



Hi,

I write this mail, because I didn't find any documentation on using the 
Logitech iTouch InternetKeyboard with all the additional keys in Linux before.
I describe, how to use of the special keys play/pause, rewind, forwind, stop, 
mute, loadness++, loadness--, home, mail, and so on, which can be found on so 
called IndernetKeyboards.

Please don't flame me for posting such a long mail. :)

This mail includes:

- Configuration of the keycode-mapping
- Configuration of my windowmanager (afterstep), to use the additional keys
- A small program, to control xmms via commandline, which can be used in 
addition to the windowmanagersettings, to use the play/pause, rewind,.. keys.

Please don't feel offended that I write this here, but since its undocumented 
yet, I feel that such information is needed to be included somewhere, or at 
least just be made public.


---------------------------------------------------
--  Configuration of the keycode-mapping (debian)
---------------------------------------------------

The iTouch keyboard sends special scancodes which have
no default meaning, and so are not mapped to any
key. I now show, how to register the additional keys
as F24-F35.
XFree4.0 stores the keycode-keysymbol-mapping files in
/etx/X11/xkb/symbols. The files there describe the special
key-symbol-mappings, which must be added to your keyboardfile.
As I am from Germany, I will show,
what I added to the 'de'-file found in the directory mentioned before:
    key <I5F>  { [ F25 ] };
    key <I20>  { [ F26 ] };
    key <I2E>  { [ F27 ] };
    key <I30>  { [ F28 ] };
    key <I22>  { [ F29 ] };
    key <I24>  { [ F30 ] };
    key <I10>  { [ F31 ] };
    key <I19>  { [ F32 ] };
    key <I6C>  { [ F33 ] };
    key <I65>  { [ F34 ] };
    key <I66>  { [ F35 ] };
    key <I32>  { [ F24 ] };
The Ixx stands for the enhanced scancode generated by
the keyboard. You can check the scancodes of your keyboard,
e.g. if you have another one, than me, if you start 'xev',
the X-Event-Viewer.
OK, now we have a lot more Functions keys, and now we want to use them.

------------------------------------------------------------
-- Configuration of a windowmanager (afterstep, as example)
------------------------------------------------------------

The following has to be added to your favorite 
GNUStep/Library/Afterstep/feels/feel.MyFavouriteFeel

# Home       
Key F24         A       A       Exec "konqueror" exec konqueror & 
# Sleep        
# Key F25         A       A       Exec "reboot" exec  reboot
# Mute
Key F26         A       A       Exec "mute" exec gom -d /dev/mixer -m    
# Loadness++
Key F27         A       A       Exec "louder" exec gom -d /dev/mixer -l-3
# Loudness--
Key F28         A       A       Exec "notloader" exec gom -d /dev/mixer -l+3
# Play/Pause
Key F29         A       A       Exec "playpause" exec xmmsctrl 3
# Stop
Key F30         A       A       Exec "stop" exec xmmsctrl 6     
# Rewind
Key F31         A       A       Exec "rewind" exec xmmsctrl 4          
# Forwind
Key F32         A       A       Exec "forwind" exec xmmsctrl 5          
# Mail
Key F33         A       A       Exec "mail" exec kmail &         
# Search 
Key F34         A       A       Exec "search" exec konqueror 
http://www.google.de                  
# Favorites
Key F35         A       A       Exec "favs" exec konqueror 
http://myfavouritehomepage.de

This maps the keys to actions. Other windowsmanagers might be configured in a 
more easy manner, but the most important thing are the programs to be 
executed when the keys are pressed.

gom is in the package 'gom'. It is a commandline mixer control.
xmmsctrl is a program i wrote myself to have a lightwight process for mapping 
my newly created function keys to a running instance of xmms.

kmail and konqueror are sophisticated KDE Mail and Web-Clients.

--------------------------------------------
--  xmmscontrol
--------------------------------------------

Compile with:

gcc xmmsctrl.c -I/usr/lib/glib/include -lxmms -o xmmsctrl

CODE BEGIN:

#include <glib.h>

int main(int argc, char* args[]) {

    gint vl, vr; 
    int param = argc==1?0:atoi(args[1]);
    switch( param ) {
        case 0: printf("xmmsctrl V1.0   by Daniel Migowski\n");
	        printf("USAGE: xmmsctrl [-n], where n is\n");
		printf("       play=1, pause=2, toggleplaypause=3, next=4, prev=5\n");
		break;
	case 1: if (!xmms_remote_is_playing(0)) xmms_remote_play(0); break;
	case 2: xmms_remote_pause(0); break;
	case 3: if (xmms_remote_is_playing(0)) xmms_remote_pause(0);
	            else xmms_remote_play(0); break;
	case 4: xmms_remote_playlist_prev(0); break;
	case 5: xmms_remote_playlist_next(0); break;
	case 6: xmms_remote_stop(0); break;
    }
    return 0;
}

CODE END.

------------------------------------
-- End of all 
------------------------------------



Reply to: