Geoff
Geoff

Reputation: 9590

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 to 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?

Upvotes: 1

Views: 590

Answers (1)

n. m. could be an AI
n. m. could be an AI

Reputation: 120031

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.

Upvotes: 2

Related Questions