kiibohd / KiiConf

Input Club web configurator, designed by matt3o.
http://configurator.input.club
GNU General Public License v3.0
92 stars 30 forks source link

WhiteFox started dropping inputs and holding down keys while in 6KRO mode #78

Open r3Fuze opened 7 years ago

r3Fuze commented 7 years ago

I have to run my keyboard in 6KRO mode because some ISO keys don't work in NKRO. See this issue: https://github.com/kiibohd/KiiConf/issues/70

Everything had been running fine in 6KRO for several months until my keyboard randomly decided to randomly not send key inputs and some times never release the keys until I press them again. I know its an issue with 6KRO because when I switch to NKRO the problem goes away but then I can't use some of my keys.

I don't really have much information I can give because I have no idea what is causing this, but let me know if you need anything.

DarkDefender commented 7 years ago

@r3Fuze as a fix for the ISO# issue:

I don't know why the ISO# mapping even exists, just bind the key to "\" instead and it will work flawlessly. At least, it does for me with the swedish keyboard layout.

This works because if you look at the ANSI keyboard layout the ISO enter key cover the " \" key. This key is then "moved" down to the "ISO#" position. So if you map the ISO# key to the ANSI "\" keycode the OS will do the right thing regardless of keyboard layout set.

Perhaps you can try to reflash your keyboard with the latest firmware regardless? I had a problem with LEDs turning off if I didn't unplug the keyboard for a few weeks. However that issue seems to be gone now when I reflashed it with a newer firmware version.

@jbondeson Why isn't the "ISO#" simply mapped to the "\" keycode? I had this problem at first when I got my keyboard and tried to map the keys correctly to the ISO layout. But after thinking a while, I mapped it to "\" and now it works perfectly in Linux with NRKO.

r3Fuze commented 7 years ago

@DarkDefender Did you use the online configurator or build the keymap yourself, because I can't find any way to insert a backslash in the configurator.

DarkDefender commented 7 years ago

@r3Fuze Yes, I used the online configurator.

Hmm, I see now that the backslash key is on the "<>" key on the danish layout. (It is next to the 0 key on the swedish one).

I can simply type backslash with altgr+that key. Are you saying that it doesn't work for you with altgr+">< key"?

If that is the case I've uploaded my config here: https://gist.github.com/DarkDefender/456e319e713a8534af9b957a2882a792

You can try to use it if you like. Just copy the code and paste it in the "import map" window in the online configurator

r3Fuze commented 7 years ago

@DarkDefender When I try to type a symbol that requires a modifier like shift or alt, it just registers the modifier and never the symbol. Edit: Not all keys but some of them.

I'll try modifying your map to see if it works. Thanks.

r3Fuze commented 7 years ago

@DarkDefender Replacing ISO# with backslash seems to have worked. I'll roll with this for now. Thanks!

DarkDefender commented 7 years ago

@r3Fuze Nice! I guess that is works in NKRO mode also? And you are still on windows, correct? You can try the NKRO out here: https://www.microsoft.com/appliedsciences/KeyboardGhostingDemo.mspx

r3Fuze commented 7 years ago

@DarkDefender I'm on Windows and this works in both 6KRO and NKRO.

DarkDefender commented 7 years ago

@haata maybe you can chime in on why ISO# != ANSI \ ? To me, it seems like they should have the same keycode.

haata commented 7 years ago

It's probably a historical AT->PS/2->USB HID thing. Depending on which locale you have set on your OS, USB Codes are interpreted in different ways. This is really annoying, and while I'm working on ways to simplify this, it's defined in the USB spec so there's not a lot I can do about it.

Another thing I'm working on that may help is using unicode directly instead of USB Codes, then using a driver on the host side to figure out what keys should be which. This won't work in BIOS mode however, and so it still requires me to handle the USB spec correctly.

DarkDefender commented 7 years ago

@haata I'm just wondering which one is the "correct" keycode to use here. It seems like for me and fuze that the ANSI\ keycode just works fine. And because the ISO# only works in 6KRO, I don't really see the need to have it in the configurator. Well, we need to have something to bind the correct keycode, but it seems to me that ANSI\ keycode should be used instead (because it works in both 6KRO and NKRO).

I'm wondering when the ISO# should be used. On my other swedish/nordic PS2 and USB keyboards, it seems like that specific key is bound to ANSI\ and not ISO#.

DarkDefender commented 7 years ago

BTW, found this in the SDL wiki: https://wiki.libsdl.org/SDL_Keycode

"#" (ISO USB keyboards actually use this code instead of 49 for the same
key, but all OSes I've seen treat the two codes identically. So, as an
implementor, unless your keyboard generates both of those codes and your
OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH
instead of this code. As a user, you should not rely on this code
because SDL will never generate it with most (all?) keyboards.)

So it would seem like it is rarely used in practice. (That is, for most if not all OSes, ANSI\==ISO#)