Read F1 key pressed

Non release banter
Post Reply
User avatar
Slaxmax
Contributor
Contributor
Posts: 403
Joined: 03 Jan 2013, 09:51
Distribution: KDE4
Location: Campinas Brazil https://goo.gl/yrxwKi

Read F1 key pressed

Post#1 by Slaxmax » 16 Oct 2014, 22:31

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
“DNA is like a computer program but far, far more advanced than any software ever created.”
― Bill Gates, The Road Ahead

User avatar
brokenman
Site Admin
Site Admin
Posts: 5439
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Read F1 key pressed

Post#2 by brokenman » 17 Oct 2014, 02:13

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Slaxmax
Contributor
Contributor
Posts: 403
Joined: 03 Jan 2013, 09:51
Distribution: KDE4
Location: Campinas Brazil https://goo.gl/yrxwKi

Re: Read F1 key pressed

Post#3 by Slaxmax » 17 Oct 2014, 23:57

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
“DNA is like a computer program but far, far more advanced than any software ever created.”
― Bill Gates, The Road Ahead

Post Reply