octalmage / mDesktop

mDesktop is a lightweight application that allows the user to utilize multiple virtual desktops.
Other
242 stars 46 forks source link

Alt + Number works only once #21

Open damon-kronski opened 9 years ago

damon-kronski commented 9 years ago

Hello there

I found a really small "bug": If you're on Desktop 1 and press Alt + 2 you switch but if you release only the 2 and press the 1 again it won't switch. It doesn't really interfere the work but I thought I say what I regognized.

And thanks guys!! You've done greate work!

Regards Damon

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/5317616-alt-number-works-only-once?utm_campaign=plugin&utm_content=tracker%2F1897034&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1897034&utm_medium=issues&utm_source=github).
octalmage commented 9 years ago

Hey Damon!

Thanks for the report. This may be a limitation of AutoHotkey but I'll look into it. I feel like it should work.

MPagel commented 9 years ago

My guess (without knowing much about the guts of either ahk or mDesktop) is this is a limitation of the level of key rollover of the keyboard itself. Basically, when a key is pressed in the typical mode, it sends a "make" code. When a key is released it sends a "break" code. If the maximum number of registered simultaneous keypresses is already registered, it doesn't remember which keys have been "made" and sometimes fails to send a break if a key is released (or only sends a partial break, as control and alt are actually sometimes registered as two keypresses EACH). Some keyboards have overall low key rollover, but build in special support for things like control-alt-delete and shift-FN-F1. "Gaming" keyboards often give you 4-5 key rollover for W A S D, but just 1-2 keys otherwise.

I ran into this issue when making an custom assembly-level keyboard logger for an application where I was measuring the duration (and frequency) that each key was held down. On my keyboard I could register up to 6 simultaneous keys. On my client's laptop it was only 2-3 keys. So, she had to buy an external keyboard to make it work, as she often needed 4 keys pressed at once.