SWY1985 / CivOne

An open source implementation of Sid Meier's Civilization.
http://www.civone.org/
Creative Commons Zero v1.0 Universal
244 stars 49 forks source link

Text input uses scancodes for "," and ".", causing multiple characters when pressing "v" or "w" in Dvorak #333

Closed AlexFolland closed 7 years ago

AlexFolland commented 7 years ago

I was just using FindCity to find Novograd and discovered that it was adding a "." character after the initial "No". Backspacing just the period and continuing typing the name added the period again. The only workaround I could find was adding the "v", then going back, removing the period, then going to the end (and the end key doesn't work there), and typing the rest.

SWY1985 commented 7 years ago

That's very odd, and I can't reproduce it. Does this happen in other input boxes as well? City or leader name for example?

Also, should the Home and End button work? I'll add them...

AlexFolland commented 7 years ago

Yes, nice. I agree that the Home and End keys should work even if they don't in Civilization. Not having particular standard text input keys is not a nostalgic or enjoyable property of the game.

I made a small video demonstrating the issue. Here it is.

http://lex.clansfx.co.uk/requested/CivOneperiodafterNoissue.mkv

SWY1985 commented 7 years ago

It still does not happen on two of my machines. I'll try my laptops later tonight, and I'll have a look to see what might cause this.

AlexFolland commented 7 years ago

Ah, I see why it's happening. I am a Dvorak user. It's using the keyboard scancode for , and . characters, but the Windows keycode for letters, so, when I press "v", which is in the same location as the "." is on qwerty, it is effectively pressing both simultaneously. All text input should use keycodes rather than scancodes.

SWY1985 commented 7 years ago

Good work! I'm going to solve this soon then.

SWY1985 commented 7 years ago

@AlexFolland The problem is fixed, thanks to you.

I have also added support for the Home and End keys, for entering numbers using the keypad and I've implemented the Delete key.

AlexFolland commented 7 years ago

Thanks! Great job.