In bash scripting, how can one check if a key is down?
I just wrote a "on start up" script for Mac OS X and want it t开发者_运维问答o NOT fire if I hold down a key, e.g. the shift key.
Anyone know how to check if the shift key is down from a bash script?
You need to interface with a Mac-OS-X-specific API that has this "hold down a key" concept. There's no such thing in bash, nor in related Unix/POSIX APIs. Doubly so with the modifier keys like Shift or Control.
精彩评论