Author Topic: Send keystrokes ignoring the keyboard mapping?  (Read 9774 times)

Ethan Harris

  • Guest
Send keystrokes ignoring the keyboard mapping?
« on: May 21, 2016, 11:26:09 AM »
I was trying to create some new commands using the Key Press action and I found that it's mediated by the keyboard map. Since I'm a Dvorak keyboard user, that meant that when I tried to create a command "Alpha" that pressed the "a" key, it worked (the "A" is in the same location on Dvorak and QWERTY) but when I tried to create "Bravo" to press "b", it instead pressed "x", which is the key in Dvorak you get if you press the key in the middle of the bottom row.

What's the correct way to handle this? I could just enter my commands with the "wrong" Dvorak keystrokes--which only overlap with QWERTY for A and M, but that will a) be confusing, and b) not work on some games that ignore the Windows keymap and just use the keys as if they were QWERTY--in that case, I'd say "Bravo" and get an "x", or maybe even a "q" (the Dvorak key where QWERTY x is) depending.

Thanks for any help.

Ethan Harris

  • Guest
Re: Send keystrokes ignoring the keyboard mapping?
« Reply #1 on: May 21, 2016, 11:53:10 AM »
Ah, I just found that if I switch Key Input Method from Windows Game (DirectX) to Standard, it presses the correct key regardless of keyboard mapping. But elsewhere I've read it's better to use Windows Game rather than Standard. Will I be losing anything by using Standard?

TheGrayFox

  • Newbie
  • *
  • Posts: 16
Re: Send keystrokes ignoring the keyboard mapping?
« Reply #2 on: May 21, 2016, 01:39:52 PM »
If the game your playing is responding to the key presses using Standard input, you shouldn't be missing anything.  The problem is some games might not respond to the Standard input.

I've always used QWERTY keyboards, so I didn't even realize this is an issue.  Why would a Dvorak key send a different signal just because it's in a different physical location?  And why only on DirectX?  Doesn't make much sense to me.  Makes me wonder if something else is going on to cause this.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4785
  • RTFM
Re: Send keystrokes ignoring the keyboard mapping?
« Reply #3 on: May 21, 2016, 01:54:29 PM »
I've always used QWERTY keyboards, so I didn't even realize this is an issue.
Yeah...This is a major thing for any non-ANSI/non-QWERTY layout, actually. Modifying the controls every time you buy a game is pretty normal. It's improved recently , but even AAA releases(*cough*console ports*cough*) don't always recognise alternative layouts automatically.

It's especially fun when games actually don't see the difference, which means WASD works fine, but then you have to go off hunting for various keys like ";" and "~", which don't actually have those things written on them, but are recognised as such.

That said, you can pry my big ISO enter key from my cold, dead hands.

Ethan Harris

  • Guest
Re: Send keystrokes ignoring the keyboard mapping?
« Reply #4 on: May 21, 2016, 02:17:45 PM »
I've always used QWERTY keyboards, so I didn't even realize this is an issue.  Why would a Dvorak key send a different signal just because it's in a different physical location?  And why only on DirectX?  Doesn't make much sense to me.  Makes me wonder if something else is going on to cause this.

Ah, if it wasn't clear, I don't have a physical Dvorak keyboard (that would be a real mess, as that would place, for instance, the WASD keys where your comma, A, semicolon and H keys are). I have a standard QWERTY keyboard but have switched to the Dvorak key layout in Windows.

So "Standard", going through the Windows mediation, sees a command to "type S" and causes the semicolon keysym to be sent, generating an S via the Dvorak keymap, and all is well. The DirectX method, OTOH, causes the S keysym to be sent, but that still goes through the keymap, which results in an O being generated (as in Dvorak the four leftmost keys on the home row are AOEU).