0

I'm currently very new to Bash and Linux in general, And I'm trying to automate a task which require the user to hit Fn+F6.

My question is how to make bash check if the user hit Fn+F6

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • `Fn` is not a normal key that sends a scancode to the computer, but rather a modifier key that modifies the behavior of other keys.[check here](https://stackoverflow.com/a/24503230/21705273) – Snell Apr 29 '23 at 06:14
  • Do you need the user to hit Fn+F6, or do you need to send that to the application you're automating? – Barmar Apr 29 '23 at 06:36
  • @Barmar I need the user to hit Fn+F6 and to catch this keystroke as an input and then validate the input is in fact Fn+F6 – CoffeeGod42 Apr 29 '23 at 06:46
  • Fn+F6 is a special key combination, which is likely to be different across machines, and also "eaten" by the OS before it gets to the shell (if e.g. it represents the mute button). Check out [this question](https://unix.stackexchange.com/questions/294908/read-special-keys-in-bash) for how to figure out what key code it generates, if any. – Sir Athos Apr 29 '23 at 16:31

0 Answers0