Page 1 of 1

[wheybags][0.16.20] opening Lua console ingame prints buffered char

Posted: Sat Jan 27, 2018 6:24 pm
by TheBearKing
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.

Re: [0.16.20] opening Lua console ingame prints buffered char

Posted: Mon Jan 29, 2018 5:42 pm
by eradicator
This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.

Re: [0.16.20] opening Lua console ingame prints buffered char

Posted: Mon Jan 29, 2018 6:58 pm
by Bilka
eradicator wrote:This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.
Does it? It defaulted to ö on my German keyboard.

Re: [0.16.20] opening Lua console ingame prints buffered char

Posted: Mon Jan 29, 2018 8:07 pm
by eradicator
Bilka wrote:
eradicator wrote:This is one of the reasons i remapped the console to <enter>. On german layout it always starts with e.g. <^/> otherwise.
Does it? It defaulted to ö on my German keyboard.
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 :P. But if you assign console to <^> (i.e. the key to the left of 1) then it does show this behavior.

Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char

Posted: Tue Feb 06, 2018 9:30 am
by wheybags
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.

Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char

Posted: Tue Feb 06, 2018 10:10 am
by eradicator
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.
As a hacky/ugly/dirty workaround, would it be possible to just remove any garbage when the console is typed into the first time?
  1. Player opens console
  2. Player types slash "/"
  3. Result is "*/"
  4. 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

Posted: Tue Feb 06, 2018 12:38 pm
by wheybags
Not really, since typing a unicode chracter as the first char in a chat message is a pretty reasonable thing to do

Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char

Posted: Sun Feb 11, 2018 12:58 pm
by TheBearKing
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

Posted: Sun Feb 11, 2018 2:29 pm
by steinio
I remapped Console to ~ without Problems.

Re: [wheybags][0.16.20] opening Lua console ingame prints buffered char

Posted: Mon Feb 12, 2018 12:15 am
by TheBearKing
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.