Giter Club home page Giter Club logo

Comments (3)

meag avatar meag commented on June 3, 2024

Thanks for report - can confirm that this affects systems where the console toggle key is also a dead key. Windows is doing the translation, not Quake - we see the o key pressed, and then get sent ô, which replaces it. SDL2 doesn't currently detect deadkeys correctly, so we actually have two bugs - if you set con_tilde_mode 1, you can replicate this on any keyboard by pressing the ^ key and then o, you'll see the deadkey produce a letter and then the ô (which in Quake is the brown t character). The reason "now press exactly once "W" or a movementkey of your choice" is required is because otherwise you've double-tapped ^, windows produces ^^ which is ignored as you're still in the game, and then Windows is out of its deadkey-mode and the next letter appears correctly.

Working around this is going to be a headache, we get one event for the key pressed (which is always in American layout) and another with the translation to the locale. So I can't just ignore the second event, because then when you press z on a german layout you'll get the letter y appearing on your screen. I'll need to think about it some more.

Workarounds at the moment would be:

  • Creating a layout in windows where ^ is not a dead key (Keyboard Layout Creator for Windows)
  • Binding a different key to toggleconsole

My preferred solution at the moment is to ignore the translation on first keypress after toggling console, if it produces a character code >= 128. And that's using 'preferred' loosely - everything else I have thought of is even worse.

All other suggestions welome...

from ezquake-source.

onethree7 avatar onethree7 commented on June 3, 2024

meag, Thank you for the answer and very good explanation of what´s happening!!
maybe i have a super lame mega cheap way of getting rid of this 💃

What if you auto-send an "backspace" the moment a player requests console? That would clear the special character that would be coming up on next keypress i believe, wouldn´t it? :)

I couldn´t think of any negative sideaffects at the moment, f.e. if a player would use backspace as a "say hi" or even "+attack", that wouldn´t be triggered when console is down.

from ezquake-source.

meag avatar meag commented on June 3, 2024

Thanks @onethree7, I had considered faking input from the operating system level but then ezquake would have received another copy, so I'd have to ignore it - didn't know backspace cancels the deadkey state, so that might work well. I'll give it a test this weekend.

from ezquake-source.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.