LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to have no interpretation of special characters (ctrl, tab ...) in a script (https://www.linuxquestions.org/questions/linux-general-1/how-to-have-no-interpretation-of-special-characters-ctrl-tab-in-a-script-260467/)

xround 11-29-2004 07:05 AM

how to have no interpretation of special characters (ctrl, tab ...) in a script
 
Hello,
does anyone know how to disable interpretaion of special characters in a script ?
I would like to get a script that breaks whenever I press any key of the keyboard, for say during 5 seconds.
I have the following script.

Code:

i=5
while [ $i -ge 0 ]; do
  tput cub1
  echo -n "$i"
  read -n1 -t 1 keypressed <&1
  if [ ! -z "$keypressed" ]; then
    echo "stop"
    break
  fi
  let $[ i -= 1 ]
done

It is ok when I press alphanumeric keys, but it doesn't work for keys like "tab" key or "ctrl" key.
Any help will be very appreciated.

Thanks, xround

theYinYeti 11-29-2004 07:21 AM

The keys you describe are configured as Modifiers in your X configuration. Reconfiguring the keyboard so that they are not modifiers anymore is the only clean solution I see.
I think this reconfiguration can be done on a per-application basis using xmodmap (or is it something else?)

Yves.


All times are GMT -5. The time now is 11:46 PM.