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

how to tell which key was pressed to execute a script?


I'd like to be able to call a script with multiple keys in a way
that it would know how it was called. The main reason I want to do
this is to gain more flexibility and make it a little more elegant:
changing the keymaps so that F2, for example, starts mutt is handy,
but less elegant than assigning the function "Console_11" to the
otherwise unused windows key to get me to my own X console. 

An even better solution seems to use the "kbrequest" function mapped
to a certain key. That way one can use it even from within an editor
to, say, change the keyboard layout, etc. without printing "loadkeys
..." to the screen, as it were if one used such a definition in the
keymap with strings. 

Now is it possible to assign the same function ("kbrequest") to more
keys and then use a different mechanism in the script to know what
to do, based on the key that was pressed to call it? A special
variable, maybe?

(Well, I know I could add some functions to the kernel-definitions
but is it really the only way?)

echo ${girl_name} > /etc/dumpdates

Reply to: