2 posts
Location
West Yorkshire, England
Posted 01 March 2015 - 10:45 PM
Ok so i have an OS i've been working on for 2 years and felt like it'd be an amazing feature to add something like CTRL+R to refresh the desktop, now here's my problem, i can't find the code where computercraft binds CTRL+T to terminate a process in which i was going to use to help me do what i planned and was wondering if anyone else could help me to figure it out, any help is appreciated :)/>
8543 posts
Posted 01 March 2015 - 11:07 PM
The Ctrl-R, Ctrl-S, and Ctrl-T key combinations are all detected on the Java side of things, so you won't be able to change their behavior, with the limited exception of ignoring the terminate events that Ctrl-T creates.
7083 posts
Location
Tasmania (AU)
Posted 02 March 2015 - 12:29 AM
You can detect other Ctrl + key combos, though: If you're holding Ctrl, then pressing a character key will generate a key event, but won't generate the corresponding char event like it usually would.
Thus if you queue a custom event after pulling a key event, you can determine whether Ctrl was being held down at the same time based on whether a char event comes out of the queue before your custom event does.
2 posts
Location
West Yorkshire, England
Posted 03 March 2015 - 06:35 PM
Ah okay then, i'll try what Bomb Bloke said and if that doesn't go too well i'll try other things, thanks anyways :)/>