check for keyboard press while using another application (such as Chrome)

4 views (last 30 days)
Hello,
I am wondering if it is possible to launch a script, which waits for a specific keyboard key to be pressed before proceeding with the execution.
I know this is possible within matlab environment, but I need it when I am using other applications (such as Word or browsing on the Internet).
As such, I would like to:
1) launch the script,
2) open another application, while the script is waiting for the keyboard key to be pressed,
3) the script should detect the key in order to fully executed.
Thank you.

Answers (1)

Jan
Jan on 7 Jan 2021
The key should be caught, while the browser is the active window? This is a keyboard sniffer and running it might be conflict with the laws. Another problem is the usability: it is not the expected behavior of a software to catch user actions in other programs. So this could or should confuse the users of your program.
  1 Comment
Giovanni Franzini
Giovanni Franzini on 7 Jan 2021
My intention is to launch the script while browsing and by hitting a specific key (while the browser is the active window) to capture a screenshot and perform some analysis on it. It is just for personal use of course!

Sign in to comment.

Categories

Find more on Desktop in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!