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

Things that we don't consider worth fixing at this moment.
TheBearKing
Inserter
Inserter
Posts: 29
Joined: Wed Jul 05, 2017 12:01 pm
Contact:

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

Post 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.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

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

Post by eradicator »

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.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

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

Post 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.
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.
User avatar
wheybags
Former Staff
Former Staff
Posts: 328
Joined: Fri Jun 02, 2017 1:50 pm
Contact:

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

Post 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.
User avatar
eradicator
Smart Inserter
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

Post 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()
User avatar
wheybags
Former Staff
Former Staff
Posts: 328
Joined: Fri Jun 02, 2017 1:50 pm
Contact:

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

Post by wheybags »

Not really, since typing a unicode chracter as the first char in a chat message is a pretty reasonable thing to do
TheBearKing
Inserter
Inserter
Posts: 29
Joined: Wed Jul 05, 2017 12:01 pm
Contact:

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

Post 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.
User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2638
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

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

Post by steinio »

I remapped Console to ~ without Problems.
Image

Transport Belt Repair Man

View unread Posts
TheBearKing
Inserter
Inserter
Posts: 29
Joined: Wed Jul 05, 2017 12:01 pm
Contact:

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

Post 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.
Post Reply

Return to “Won't fix.”