Stefan-Z-Camilleri-zz / Windows-Cursor-Hider

A small script written in AutoHotKey that hides the windows mouse cursor when a user starts typing, and shows it again when the user is done.
http://stefan-z-camilleri.github.io/Windows-Cursor-Hider
MIT License
117 stars 22 forks source link

[Improvement request] Hide when pressing space bar and backspace #8

Open ricprd opened 2 years ago

ricprd commented 2 years ago

As it is common when editing text files, it would be great if this utility could also hide the cursor when pressing the space bar and backspace. Maybe apply this to the Del key as well.

Thanks for this great utility!

justindemuro commented 2 years ago

On line 19 and 20 you see the following:

19: ; Register the keys you want to listen on
20: keys = ``1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./

I suspect you can add {Space} and {Backspace} to the keys list as so:

19: ; Register the keys you want to listen on
20: keys = ``1234567890-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./{Space}{Backspace}

This is per AHK documentation in 'keystrokes, sending' index item. See https://www.autohotkey.com/docs/commands/Send.htm Let me know if it works out.

ricprd commented 2 years ago

Sadly that does not work, as the keys variable is parsed so adding {space} would simply make it turn into {, s, p, a, c, e, } for the purpose of detection. I'm new to AutoHotkey so I can't figure out how to tweak it to listen to keys instead of letters.

nochkin commented 1 year ago

@ricprd I knows it's been almost a year, but I just stumbled upon it myself. I need to add space, delete and backspace as well. I have a fork created supporting those features: https://github.com/nochkin/Windows-Cursor-Hider Not sure if it's worth doing PR as I see there is another one still pending.