Thread: Capturing keyboard activity

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    14

    Capturing keyboard activity

    Hello,

    I was wondering if someone can point me in the right direction... I'm am running a GTK+ GUI and the system it is designed for has limited accessibility. What i am wanting to do is launch the GUI executable, then be able to press a key 1-4 on my keyboard to switch between GUI screens.

    I have each screen as its own function and i wanted to know if there is any way for the program to say "hey, key 2 was pressed so clear current GUI and call GUI function 2 to draw."

    The system it is designed for is Linux based

    Any help pointing me into the right direction would help greatly!

    Thanks

  2. #2
    Registered User
    Join Date
    Sep 2010
    Posts
    14
    I found a way using Ncurses! But if this is not the best way let me know!

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    There are other ways, but they are not part of the C standard - your best bet if not answered here, would be to ask this in your distro's linux web forum. I always liked Curses, Ncurses, and conio.h for DOS and Windows, but others despise it -- so many haters around. xD

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mouse activity
    By rogster001 in forum C Programming
    Replies: 2
    Last Post: 09-03-2009, 05:52 AM
  2. Get HDD Activity
    By leandroaz in forum C++ Programming
    Replies: 13
    Last Post: 10-10-2008, 12:28 PM
  3. keyboard capturing
    By xlnk in forum Linux Programming
    Replies: 4
    Last Post: 01-31-2003, 01:02 PM
  4. logging key activity
    By threahdead in forum C Programming
    Replies: 1
    Last Post: 10-03-2002, 01:05 AM