Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-10-2014, 09:41 PM   #1
Registered: Mar 2008
Posts: 52

Rep: Reputation: 15
map keyboard keys to commands (headless server)

I have a headless computer that is running as a server I want to add a wireless remote that works as HID keyboard to run scripts and the like. The remote is connected via usb and is recognized. the question I have is how to check what the kernel receives on keypresses and how to do "stuff" with those keypresses.


edit: I know it is connected and working somewhat because if i "cat /dev/input/event1" i see something when i press buttons.

Last edited by actmnophn; 03-10-2014 at 10:01 PM.
Old 03-11-2014, 08:04 AM   #2
Registered: Aug 2002
Posts: 16,350

Rep: Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908
One suggestion would be to use lirc. ( It will do the decoding and can be configured to control the computer to do lots of stuff.
Old 03-11-2014, 11:06 AM   #3
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 186

Rep: Reputation: 31
The command you can use is showkey .

The 'stuff' you could put in .bashrc or /etc/profile and define as aliases or have a look at this :
Old 03-11-2014, 08:05 PM   #4
Registered: Mar 2008
Posts: 52

Original Poster
Rep: Reputation: 15
I am going to look into those ideas thanks. One point that I am wondering is that the console is not logged into so the keys are not going to work as aliases I imagine.
Thanks again
Old 03-12-2014, 12:12 AM   #5
Registered: Mar 2008
Posts: 52

Original Poster
Rep: Reputation: 15
I got lirc setup but i still dont know how to run scripts based on key presses. I found xbindkeys but cannot run xbindkeys -k because i dont have x...
I am a little(?) lost...
Old 07-29-2017, 05:27 AM   #7
LQ Newbie
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
Apologies for being three years late but I am trying to do exactly the same thing.

xbindkeys is working perfectly for me and I don't mind having x running on my raspberry pi. But so far I haven't figured out a way to start x automatically on boot.

I have also found another method which doesn't require x running. It runs as a daemon listening for keystrokes and runs scripts.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to match X keyboard layout with the the kernel keyboard map? Didier Spaier Slackware 11 03-24-2013 03:40 PM
[xkb, xmodmap] how to map keys to combos and combos to keys me-macias Linux - Software 0 08-21-2009 03:49 PM
USB keyboard function keys/numeric keys on boot raypen Linux - Hardware 4 04-17-2008 04:07 PM
Map Keys Under 3dDesktop michaeljh2000 Slackware 0 01-07-2005 03:38 PM
how to map extra keys on k/b need some help here! jollyjoice Slackware 1 07-24-2004 10:51 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration