The standard button to open the Lua console is the GRAVE button. However in some keyboard layouts (like mine) this button is used to put an accent over letters. As such, when pressed it will buffer the accent and put it on the next letter you select on your keyboard.
So to summarize what happens: When opening the Lua console via the GRAVE button, in a keyboard layout where this is recognized as a buffered accent, the game doesn't clear that buffer. As a result, the accent will be printed as first character on the line when for example trying to type a command. Steps to reproduce this are:
1- press the GRAVE button to open the Lua console
2- the line remains empty at first
3- when for example typing a slash to start a command it will type: `/(accent slash) instead of just the slash
This is not a major problem, but very annoying when trying to type ingame commands. Are there ways to disable this behavior when opening the Lua console with such a special character?
My keyboard layout is United States-international on Windows 10.
Furthermore, this issue only occurs with keyboard layouts that allow the buffering of such accents. Regular English(US) doesnt show this behavior if I understood correctly from other players.
Rebinding to another key is possible, however not convenient as all the keys in proximity of your left hand are already occupied for other important features.
[wheybags][0.16.20] opening Lua console ingame prints buffered char
-
- Inserter
- Posts: 29
- Joined: Wed Jul 05, 2017 12:01 pm
- Contact:
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.16.20] opening Lua console ingame prints buffered char
This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [0.16.20] opening Lua console ingame prints buffered char
Does it? It defaulted to ö on my German keyboard.eradicator wrote:This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [0.16.20] opening Lua console ingame prints buffered char
I'm not sure what the default setting is. And i can't exactly test pressing "reset" as that would mess up my whole layout . But if you assign console to <^> (i.e. the key to the left of 1) then it does show this behavior.Bilka wrote:Does it? It defaulted to ö on my German keyboard.eradicator wrote:This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
So I looked into it, and if we wanted to have some kind of special case for opening the console, we would have to hack the underlying libraries we use for input on each os (windows, osx, linux) separately. I'm not sure that's worth it atm, especially as these are probably going to be massively changed in the near future anyway.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
As a hacky/ugly/dirty workaround, would it be possible to just remove any garbage when the console is typed into the first time?wheybags wrote:So I looked into it, and if we wanted to have some kind of special case for opening the console, we would have to hack the underlying libraries we use for input on each os (windows, osx, linux) separately. I'm not sure that's worth it atm, especially as these are probably going to be massively changed in the near future anyway.
- Player opens console
- Player types slash "/"
- Result is "*/"
- If <length_of_console_content> == 2 and console.char[2] == "/" then console.char[1].delete()
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
Not really, since typing a unicode chracter as the first char in a chat message is a pretty reasonable thing to do
-
- Inserter
- Posts: 29
- Joined: Wed Jul 05, 2017 12:01 pm
- Contact:
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
Thanks for the reply. Hopefully there is a fix for this when it is easier to implement/when there is time for it. Luckily it is only a minor thing.
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
I remapped Console to ~ without Problems.
-
- Inserter
- Posts: 29
- Joined: Wed Jul 05, 2017 12:01 pm
- Contact:
Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char
Whether or not you have a buffered character depends on your keyboard layout. The common English layout for example doesn't allow character buffering, so those will not run into this issue. Try setting your layout to one which allows accents and other symbols on letters, and see whether or not you get issues with the console.