Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-12-2005, 01:32 PM   #1
LQ Newbie
Registered: May 2005
Posts: 1

Rep: Reputation: 0
Keyboard hooks

Can someone tell me if there is a way to create a type of Keyboard Hook so that any input typed on the keyboard will go through my program first?

I know I can do it by rewiring the keyboard driver, but I'm hoping for a way to do it without messing with any kernel drivers.


Old 05-13-2005, 04:31 PM   #2
Registered: Apr 2004
Location: Timisoara, Romania
Distribution: Debian
Posts: 90

Rep: Reputation: 15
Re: Keyboard hooks

Originally posted by icemanind
Can someone tell me if there is a way to create a type of Keyboard Hook so that any input typed on the keyboard will go through my program first?
You mean a keylogger, right?

Why would you wanna do such a thing?
Old 05-13-2005, 08:22 PM   #3
Registered: Feb 2004
Location: Lexington, MA
Distribution: Gen2
Posts: 39

Rep: Reputation: 15
pipes and processes

I've been wanting to do the exact same thing although I've been trying to allow for a user to enter in keyboard input, which is routed to two programs.
Some interesting advice i've recieved is to write a wrapper program that runs the two programs in question as a process(or aparantly pthreads) and pipes the keyboard input to both. You might want to look up processes and pipes, let me know if you're sucessfull or find something new because im still stuck on implementation.

Last edited by caffeinebot; 05-13-2005 at 08:34 PM.
Old 07-19-2006, 05:01 AM   #4
Senior Member
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Maybe you can get some ideas by looking at the source code for lkl (Linux Keylogger) and then improving it. It needs lots of improvements. I hope you make your keylogger available for Ubuntu in the universe or multiverse repositories. Also your program will be much better than lkl if it has a better output than lkl with time and date and html format. It would be MUCH better if lkl simply sniffed the raw
port data (or read it and echoed it to the kernel) and
logged that, and then came with a viewer to decode the
raw logs. This way there is NO translation done by lkl
to the actual datastream, eliminating any chance of


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
about mac layer lsm hooks chandakumesh Linux - Wireless Networking 2 08-26-2005 03:09 PM
about mac layer hooks chandakumesh Linux - Networking 1 08-26-2005 02:47 PM
application of networking using lsm hooks chandakumesh Linux - Security 1 08-26-2005 12:59 PM
about mac layer lsm hooks chandakumesh Linux - Security 1 08-26-2005 12:58 PM
mutt hooks cbb Linux - Software 2 08-14-2005 01:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:55 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