Pressing Right Alt enters edit.lua's menu, which makes it difficult to program with a french AZERTY keyboard layout.
spr2-dev opened this issue ยท 3 comments
Background
I use a french AZERTY keyboard layout.
For all of the other layouts users out there, some characters that are widely used in programming (such as {
,[
, their closing counterparts, and \
) need a specific key combination to get them written onto the screen (see the layout image below).
This combination uses the Right Alt
key, to access these special chars (eg. R-Alt + 5
to get an opening square bracket).
Issue
However, as seen in edit.lua's source code, the Right Alt key is used to toggle the menu where you can save, run, exit.
So, to write one of those special chars, you need to enter the menu first, then type the combination (which exits the menu and registers the special char in the file you're editing).
This makes editing in-game really annoying, especially when dealing with tables and indexes.
Repro Steps
Install a French AZERTY layout,
Run the edit.lua
program on any computer,
Try to write a special char that uses a Right Alt combination.
Below is an example of an AZERTY layout, so you know where to type.
The R-Alt key is labeled "Alt Gr" in this example, and the chars that can be accessed with it are in blue.
Useful information
This issue is present on each branch I could find on this repo (1.13+), and I reproduced it in MC 1.14.4 (CC:T 1.85.1)
I didn't make a PR because I don't have any experience with downloading, building & testing Java projects.
I wonder if we could have a nice way of custom keybindings. I've done them in an unreleased project and they are quite easy to do. The user has to look up the keys API entries for what key they want to do, but a separate keybinding program which ties into this could help with that.
settings.define("nao.keys.altActivate", { default = "leftAlt", type = "string", description = "The key to press to open the interaction menu.", })
local key = {
-- snip
altActivate = settings.get("nao.keys.altActivate"),
}
while true do
local event, eventInfo = os.pullEvent()
-- TODO: click events
if event == "key" then
local keyCode = eventInfo
if keyCode == keys[key.altActivate] then
altActivate()
else
-- snip
end
end
end
related #368