808 posts
Posted 20 October 2012 - 03:00 PM
The more I program for CC, the more I need key combos. I need the user to be able to say something without actually typing in a command or anything. The only way I can think of for CC to do key combos would be detecting when something like a key combo is pressed and sending it as an even with the keys pressed as the parameters. I'm sure there's a better way to make this function than that but I can't think of it. Doesn't change the fact that we really need key combos!
2005 posts
Posted 20 October 2012 - 05:10 PM
You don't need to send it as an event, you just detect the first key and then look for the next key.
I usually use capital letter characters when I "need" a key combo, but that only works for letters/numbers used with Shift. Still, it's easy enough and I can be kinda lazy.
808 posts
Posted 20 October 2012 - 08:02 PM
You don't need to send it as an event, you just detect the first key and then look for the next key.
I usually use capital letter characters when I "need" a key combo, but that only works for letters/numbers used with Shift. Still, it's easy enough and I can be kinda lazy.
But you can't detect if they've released the first key when they press the second one. For all I know, they tapped control then S, not ctrl+s. We need real key combos. Not hacks like capital letters and hoping they don't release.
2005 posts
Posted 20 October 2012 - 08:19 PM
The key release event poses problems because multiple users can be logged in to the same console. You could add a key release event, but then you don't know who released the key.
And if you really "need" key combos, then you wouldn't object to the user pressing Ctrl and then S immediately after (or whatever). I frankly prefer a key combo that doesn't make you hold down the keys to get the combo.
808 posts
Posted 31 October 2012 - 05:16 PM
Ok I just had a thought. What if when a key was pressed, if there are other keys down, it sends a "key_added" event instead of a "key" event. Or both. That way you can tell when a key is added, so that you can wait for "key, control" "key_add, b" in succession to listen for control b as a key combo
724 posts
Posted 31 October 2012 - 06:25 PM
Bad thought.
What if Player1 press and keep "a" while player2 press "b" ?