I am working on a way to use the [hi] object on the Mac to detect key presses and releases, much like the key and keyup objects do already (I want to detect key presses/releases when Max is not in focus though, thus the need for the hi object).
I have deciphered the output of the hi object so that I can get a list of hex symbols of the currently held keys. For each new key press or release, I get a new list. For example:
'q' held down: 14
'w' held down: 1A
'q' held down, then 'w' held down while still holding 'q' down: 1A 14
'w' held down, then 'q' held down while still holding 'q' down: 14 1A (in other words, the list order represents the sequence of when the keys were originally pressed)
nothing held down: 0
So what is the best way to be able to easily track this continually changing list of symbols, to be able to detect new keys that are pressed, as well as keys that are released? I have a feeling one of Peter Elsea's Lobjects is going to help me here (though not sure which!), but curious if there is a way to easily do it with built in Max objects too...