I need a long key press to be redirected to a device file. If I send the same key multiple times, it is considered as separate key inputs (with carrige return). I just need one long key press. How can I achieve this? Thank you. Any help appreciated!

Edit: I just meant the normal redirection operator in bash which is > or >>(append). I need a long key press to be simulated to a device file.I am just using bash for the envionment. For example: If I need to input a key to the device file, I can give a bash command

echo "s" > /dev/device

  • what do you mean by "redirected to a device file"? what application / user interface are you using? could you give an example? is your Q about distinguishing long key presses in an xkb config? (I don't think that's possible, but I may be wrong). Please add all the details to your Q.
    – mosvy
    Aug 23, 2019 at 8:11
  • 1
    Your example s > /dev/ gives the error /dev/: is a directory. I'd also expect to see the error s: command not found (unless s is a script you've also written). Please include an actual command that demonstrates the problem you're seeing. You say that you want to redirect a long key press, implying that you've got this working for shorter presses -- what's the command that works for you for short presses, and in what way are the results different to what you expect when you hold the key for longer?
    – JigglyNaga
    Aug 23, 2019 at 9:52


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.