LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How do you identity buttons in a script? (https://www.linuxquestions.org/questions/programming-9/how-do-you-identity-buttons-in-a-script-204082/)

superztnt 07-12-2004 10:09 AM

How do you identity buttons in a script?
 
I was wondering how to make a combination of buttons make a certain event happen and how to change those buttons? Like in the /etc/inittab file on this RH 7.2 box here at school it has a line to shutdown when control-alt-delete butttons are pushed. It looks like this:

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

I also like to know where to look to know how linux knows what key is pushed. If you know and dont want to give the answer away to a noob then just point me in the right direction. I'm not afraid of doing research. I have looked and looked for this on google and some books but I have had no luck. Maybe I'm using the wrong words to search or something but I'm frustrated now.

What I'm trying to do is create a script on a Unix system here at school so that when I hit a certain combination of buttons or one button it will execute something. Thanks.


Jason Z.

BluePyre 07-12-2004 01:35 PM

Theres a big difference to how Linux knows a key has is pushed, or how an application knows a key has been pushed.

I could point you in the right direction if you're wanting to use C++, and that direction is Qt, a GUI interface designer and toolkit / API (with member functions for things like key presses)

superztnt 07-12-2004 03:43 PM

Well the system that I'm working on is a RS/6000 running AIX version 3.2. So I don't have the ablilities to run GUI apps. Is there a keyboard configuration file somewhere that I should look for? I have been poking around the file system trying to find something but I have found anything yet.
What I am trying to do is create a script that will run in the background that will let me go through the bash history like in Linux where you can just up arrow. The RS/6000 has a vi command-line editor, but I want to change it so it is more like Linux.


All times are GMT -5. The time now is 01:31 AM.