This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
robhol's profile picture

key event - modifiers? ctrl-alt-shift

Started by robhol, 17 February 2013 - 08:17 AM
robhol #1
Posted 17 February 2013 - 09:17 AM
It would be great if the key event had a simple overview of modifier keys, or a way to poll them.
It wouldn't require more than 3 bools (or a 3-bit number) being sent with the keys, and has been available for a very long time, even on "old school" platforms. Basically, it'd let you easily know if the user hit Esc or Ctrl-Esc or Alt-Shift-Esc, which we can't do currently.

Any ideas on this? There's already stuff like Gopher's "ctrlkeys", but it's a hack and it shows. It does its best, but it seems like something that could be implemented directly into the mod and save everyone a lot of hassle. :)/>
Lyqyd #2
Posted 17 February 2013 - 10:29 AM
This is one of our more frequent requests. It's fairly similar to the keyUp/keyDown entry in the do-not-suggest list. I imagine we'll get one or the other or both eventually.
robhol #3
Posted 17 February 2013 - 07:46 PM
I didn't see it there, and it most definitely isn't the same. It's three extra bits in an event that exists already, vs. two entirely new events that would be triggered very often.
Dlcruz129 #4
Posted 17 February 2013 - 07:48 PM
I didn't see it there, and it most definitely isn't the same. It's three extra bits in an event that exists already, vs. two entirely new events that would be triggered very often.

Cool story bro. Its entirely up to the developers. You have plenty of keys, just use F1-12.
PixelToast #5
Posted 18 February 2013 - 05:15 AM
or just make a function to change the deley between events when you hold down a key, and the time it takes to do that
and then possibly a delta parameter (similer to love2d)
Cloudy #6
Posted 18 February 2013 - 07:02 AM
Not possible. To PixelToast.
AfterLifeLochie #7
Posted 18 February 2013 - 08:32 AM
As it stands, some clever people (or person?) have already written key modifier tracking code, if I recall correctly - it is around somewhere on the forums.
GopherAtl #8
Posted 18 February 2013 - 09:55 AM
if you mean the ctrlkeys api, the person is me, and it works quite well given certain constraints, one of which is it it only works with terminal keys that type symbols - letters, numbers, and symbols. So, ctrl-A, ctrl-3, ctrl-",", sure. Ctrl-shift-p, yes (with disclaimer). Just ctrl-shift, or shift-tab, no. See the thread for more details.