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

[1.3] AltGr keypress is interpreted as CTRL

Started by snaipperi, 06 March 2012 - 04:16 PM
snaipperi #1
Posted 06 March 2012 - 05:16 PM
When using the text editor, pressing AltGr has the same effect as pressing CTRL, which opens the Save/Exit menu, making it relatively difficult to input special characters such as { [ ] } on non-US keyboards. Wikipedia has some notes on it.

It's not completely broken though, I'm usually able to input the square brackets with little effort.
Espen #2
Posted 06 March 2012 - 08:23 PM
What I do is press it once to "activate" it, and then I press it again + the special character I want to type.
Since AltGr kind of simulates CTRL+ALT, one could alternatively press CTRL+ALT+Special Character, were it not for the ALT key to halt Minecraft and thus it resorts to the same "activate" method as with AltGr.
Don't know if anything can be done about that (I doubt it), but what could be done instead is to change the key for the menu to a more seldom used one (Like one of the F-Keys).

You can actually do that yourself. That is, if you have access to the /rom/programs/ folder.
If you don't, then you could just copy the edit-program into your CC computer's root folder and change that one instead and from then on use that one as your editor of choice.^^
Anyway, regardless of whatever version you choose, open up the edit-program in an editor and look for this line:
elseif param == 29 then
It should be on line 267.
The number 29 corresponds with the left CTRL-Key (which is interfering with AltGr).
To change it to e.g. the F1 key, just replace 29 with 59:
elseif param == 59 then
That's it, now the save menu will only appear on F1, but not on AltGr anymore.
Hope it helps, cheers. :unsure:/>/>

P.S.: All valid Minecraft-Keycodes: http://www.minecraftwiki.net/wiki/Key_Codes
Edited on 06 March 2012 - 07:28 PM
snaipperi #3
Posted 07 March 2012 - 08:49 AM
There is something beautiful about CC. Thanks for the tip! I didn't even think I could edit the edit program.

So should this be reclassified as works as intended instead of a bug?