2

I'm trying to write bash script that plays a tone while a key is held down.

Here's what I have so far:

https://github.com/thelazymastermind/pcspkr_keyboard/blob/master/keyboard.sh

It works, but the note can't be played continously while a key is held down.

If this can't be done in bash, how can it be done with C or Python?

1 Answer 1

1

Look to this projects at: http://www.shellscriptgames.com/

They use getch.c in order to get key input from user... So seems pure shell doesn't provide what you need.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm looking for a snippet of code that runs a command and doesn't stop it until the key is released. getch.c is not the answer I was looking for, sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.