LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-14-2013, 12:27 AM   #1
waddles
Member
 
Registered: Sep 2012
Posts: 372

Rep: Reputation: 1
Keyboard keys having unintended effect on program


I have a script in which I have used a trap command to execute a cleanup function if the SIGnal is encountered. The script now fails to perform when specified keys like h, H, l, L, F, q are pressed. These are the keys to direct the program. But if even a shift key or others is pressed those keys are then ignored. Those keys are read with:
read -s -n 1
The trap command is:
trap cleanup 2 3 6 15 17 18 19 20 21 23 24 26
which covers: SIGINT=2, SIGQUIT=3, SIGABRT=6, SIGTERM=15, SIGCHLD= (17,18,20), SIGTSTP=(18,20,24), SIGSTOP=(17,19,23), & SIGTTIN=(21,26).
Is the problem in the read, SIG assignments, or elsewhere?
 
Old 11-14-2013, 05:08 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062

Rep: Reputation: Disabled
If you don't post your code, how can we know what happens?

Last edited by Didier Spaier; 11-14-2013 at 05:13 PM.
 
Old 11-15-2013, 02:08 PM   #3
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
Would have posted it but it is TOOOO long.
None the less I found the problem to be generated by a 2nd read -s -n 1 without a target variable outside of a forever loop containing the other read properly targeted. Once I gave the 1st read a target the problem was corrected.
 
Old 11-15-2013, 02:08 PM   #4
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
Would have posted it but it is TOOOO long.
None the less I found the problem to be generated by a 2nd read -s -n 1 without a target variable outside of a forever loop containing the other read properly targeted. Once I gave the 1st read a target the problem was corrected.
 
  


Reply



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
Keyboard keys messed up on Logitech Illuminated Keyboard MikeyCarter Linux - Hardware 2 03-16-2010 08:25 AM
USB keyboard function keys/numeric keys on boot raypen Linux - Hardware 4 04-17-2008 03:07 PM
What program for making glass effect ? Kocil Linux - Software 7 04-05-2004 08:49 PM
Assigning keyboard shortcuts to keyboard keys the who Linux - Hardware 3 02-20-2004 09:36 PM
Keyboard delay is too long and kbdrate seems to have no effect (RH8.0) szatki Linux - General 0 02-20-2004 10:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:10 PM.

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