OESF Portables Forum

Everything Else => Zaurus Distro Support and Discussion => Distros, Development, and Model Specific Forums => Archived Forums => Angstrom & OpenZaurus => Topic started by: Bundabrg on July 17, 2006, 05:18:52 am

Title: Keylaunch And Keylaunchrc
Post by: Bundabrg on July 17, 2006, 05:18:52 am
Ok, I've searched everywhere and simply can't find documentation on keylaunch. So I've pulled apart the code and worked it out. To save someone else the same frustration, here are my notes.

Firstly, for those who don't know, keylaunch is used to bind 'commands' to hotkeys. For example, pressing 'Calendar' can load Calendar, and pressing 'Fn 3' can lower the brightness.

Keylaunch uses /etc/keylaunchrc, and can also be (overridden? in addition?) by ~/.keylaunchrc.

A typical keylaunchrc may look like this: -
Code: [Select]
# Comment

key=....F9:-:command
key=...*1:chvt 1
key=....Released F9:anothercommand


Each line has the following format ([]'s means optional. {} means its a variable):
Code: [Select]
key={flag}[{option} ]{keyname}[ {combinekeyname}][:-]:[~]{command}

Lets look at each bit seperately: -
key= - This is always the same.

{flag} - 4 characters, normally ....
 - Each character corresponds to a modifier. If the modifier is pressed at the same time, then this key will be triggered. IE, Control + 1 can give a chvt 1.
 - If the FIRST character is '?', then all the flags are ignored, and it will trigger on ANY modifier
 - OTHERWISE, each character can be '.' (not selected) or '*' (selected), and the modifiers are as follows: -
*... - Control
.*.. - Shift
..*. - Alt
...* - Fn
 - I'm pretty sure you can have more than one modifier.

[{option} ] - Optional Option. Note the SPACE afterwards if used!
  - This dictates on what event the key must trigger. If you don't specify an option it assumes when the key is pressed.
  - The events can be one of the following: -
Pressed - Occurs when the key is pressed
Released - Occurs when the key is released
Held - Occurs if the key is held for a bit
Combine - Occurs when you press TWO keys (IE Calendar+AddressBook} You MUST provide {combinekeyname}.
  - Don't forget the space!!!

{keyname} - The name of the key to trigger on
  - The names are defined in /etc/keymap-2.6.map

[ {combinekeyname}] - Iff (if and only if) the Combine option is used you specify a second key here.
  - Don't forget the space BEFORE this (ie, between key and combinekeyname}

[:-] - Try to raise an existing window
  - If this exists then when the key is triggered keylaunch will first see if there is already a running instance of the command, and if so, just bring it into focus.
  - If it is omitted, then it will load a new instance every time.

[~] - Disable startup notify
  - If this exists (IE, a tilda before the commandname), then startup notify will not be used. I think this means that you won't see the hourglass in the corner.

{command} - Command to run
  - What command to run.



Feel free to post your changes you've made to your keylaunchrc files. I'd be interested in getting some ideas.

 - Bundabrg
Title: Keylaunch And Keylaunchrc
Post by: jerrybme on July 17, 2006, 02:54:21 pm
Bundabrg:
Great info, thanks for sharing.

From my GPE tweaks thread..

Being able to use the LCD softkeys and the space between them is great. I've mapped the space below the Book icon to toggle hiding the panel. Being able to hide the panel is useful, but trying to bring it back can be difficult sometimes, so in /etc/keylaunchrc.matchbox I've modified the following line:
Code: [Select]
key=....F30:-:~matchbox-remote -panel-toggle
Jerry
Title: Keylaunch And Keylaunchrc
Post by: Bundabrg on July 18, 2006, 12:46:04 am
(Presumably some if not most of the things keylauncher does can be done by matchbox itself... Any way to map the Fn in matchbox?)


Mine is currently: -
Code: [Select]
# keylaunchrc - Created 2006, BundaBRG (slc860)

# Format: -
#  key={flag}[{option} ]{key}[ {key2}][:-]:[~]{command}

# Brightness Control (fn+3, fn+4)
key=...*3:~display-brightness.sh down
key=...*4:~display-brightness.sh up

# Virtual Terminals (ctrl+alt+#) (doesnt work)
key=*.*.1:~chvt 1
key=*.*.2:~chvt 2
key=*.*.3:~chvt 3
key=*.*.4:~chvt 4
key=*.*.5:~chvt 5
key=*.*.6:~chvt 6
key=*.*.7:~chvt 7
key=*.*.8:~chvt 8
key=*.*.9:~chvt 9
key=*.*.0:~chvt 10

# Calendar Hotkey
key=....F9:-:gpe-calendar

# Address Hotkey
key=....F10:-:gpe-contacts

# Email Hotkey
key=....F13:-:sylpheed

# Home Hotkey
key=....F12:-:gpe-mini-browser

# Menu Hotkey
key=....F11:~matchbox-remote -menu
key=...*F11:~matchbox-remote -panel-toggle

# Above Home Silkscreen
#key=....F5:

# Home Silkscreen
key=....F15:~display-brightness.sh up


# Between Home/Email Silkscreen
#key=....F6:

# Email Silkscreen
key=....F16:~display-brightness.sh down

# Between Email/Contacts Silkscreen
#key=....F7:

# Contacts Silkscreen
#key=....F17:

# Between Contacts/Calendar Silkscreen
#key=....F8:

# Calendar Silkscreen
#key=....F18:

# Between Calendar/EJ
# don't know


# E/J Silkscreen
key=....F19:~matchbox-remote -panel-toggle

# Below E/J Silkscreen
# don't know
Title: Keylaunch And Keylaunchrc
Post by: lardman on July 18, 2006, 05:21:44 am
This looks useful, could someone add it to the OZ wiki please.

http://openzaurus.berlios.de/ (http://openzaurus.berlios.de/)

Thanks,


Si
Title: Keylaunch And Keylaunchrc
Post by: Bundabrg on July 19, 2006, 12:39:59 am
See http://openzaurus.berlios.de/HowTos/Keylaunch (http://openzaurus.berlios.de/HowTos/Keylaunch)
Title: Keylaunch And Keylaunchrc
Post by: lardman on July 19, 2006, 06:29:30 am
Cool, thanks

Si