Page 1 of 1

Read F1 key pressed

Posted: 16 Oct 2014, 22:31
by Slaxmax
How to read and run an application if F1 is pressed?
In kde you can do, but would like to be able to use any other DE.
Any idea?

Thanks

Re: Read F1 key pressed

Posted: 17 Oct 2014, 02:13
by brokenman
It would depend on the desktop environment. In most applications F1 is reserved for help ... but you may be able to bind the F1 key to run your application.

Re: Read F1 key pressed

Posted: 17 Oct 2014, 23:57
by Slaxmax
I found xbindkeys, works fine
http://xahlee.info/linux/linux_keyboard_tools.html

for check keycode
example F1 key pressed

Code: Select all

guest@porteus:~$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"(Scheme function)"
    m:0x10 + c:67
    Mod2 + F1
example my ~/.xbindkeysrc
read F1 and execute script "down"

Code: Select all

# ler tecla F1
"/home/guest/.ch-pc/down"
m:0x10 + c:67