Find the answer to your Linux question:
Results 1 to 5 of 5
Hi! I'm writting application similar to AutoHotKey for Windows. First of all I need to know, which keys was pressed in system. For Windows it is so easy (some time ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    2

    Keyboard hook [C++]


    Hi!
    I'm writting application similar to AutoHotKey for Windows. First of all I need to know, which keys was pressed in system. For Windows it is so easy (some time ago I even wrote keylogger for Windows - of course for training, I used it only in my computer). I was googling for something like this for Linux i I didng find anything.

    The best I found was XSelectInput but I need something like this for many windows. If some appliaction are avoiding it becouse of security reasons it's OK - I can live with it
    I think, none of Linux users would install something that can stole their passwords, so if You know how to do this for all appliaction I will be glad. For example I can think about some hotkeys in my internet browser, but this is application where are users are writting the most passwords.

    I want to write it for Gnome first. Then, if I would make good appliaction I want to extend it for KDE and maybe another.

    I'm sorry for my English - I'm still learning.

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    if you are looking to do it for gnome at first, you should take a look at GTK, since that is what gnome uses

    KDE uses QT

    the regular X window programming will work on anything with X, but it may be more cumbersome

  3. #3
    Just Joined!
    Join Date
    May 2010
    Posts
    2
    I think I found the function. It's inb(). When I finished first version I will post

  4. #4
    Just Joined!
    Join Date
    Sep 2010
    Posts
    14
    Quote Originally Posted by SubArrin View Post
    I think I found the function. It's inb(). When I finished first version I will post
    hi...
    i realy need this...
    i also go threw x window programming,does anybody know which function should be used to achieve the result..
    in x i can extract events for a single window i create,but for other application i dont know how??

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    The most appropriate means to do this consistently for all keyboard input in the system would be to install a kernel module that would intercept the keyboard interrupts, then pass the data to the normal user-space code as well as your user-space code that will do something special with it.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •