#1 2015-03-26 16:43:36

mash
Member

Use key by location. Different keyboard layouts.

I use the dvorak programmer layout on fedora. At the moment no matter what keyboard layout I got selected my primary keyboard layout will be used for the game which is the dvorak programmer keyboard layout. Instead my primary keyboard should only be used when I'm typing in chat. Also I can not bind most keys because they're special chars and https://wiki.libsdl.org/SDL_Keycode only has keycodes for them. So I can't use most numbers etc.

Offline

#2 2015-03-26 18:25:37

RaZgRiZ
Moderator

Re: Use key by location. Different keyboard layouts.

mash wrote:

I use the dvorak programmer layout on fedora. At the moment no matter what keyboard layout I got selected my primary keyboard layout will be used for the game which is the dvorak programmer keyboard layout. Instead my primary keyboard should only be used when I'm typing in chat. Also I can not bind most keys because they're special chars and https://wiki.libsdl.org/SDL_Keycode only has keycodes for them. So I can't use most numbers etc.

The game is primarily made to run with QWERTY keyboards, so the binds will be all over the place with DVORAK. My ALUI mod would make it relatively easy to modify all the binds to different keyboards, but i don't specifically have such a system in place currently, which means that if you were to try it you would have to go through a ton of copy/paste.

Offline

#3 2015-03-27 13:44:34

mash
Member

Re: Use key by location. Different keyboard layouts.

Well other games just treat the keyboard as qwerty as long as you don't type and that's what I would expect.  The problem is not dvorak. With dvorak I could just rebind everything to the default positions (wich is still a lot of work) but with the programmer dvorak keyboard layout I don't have numbers! Well I have them if I press shift but there're a lot of keys which I can't bind because they got no name. For example I can't bind the left curly brace { Programmer Dvorak

Last edited by mash (2015-03-27 13:46:17)

Offline

#4 2015-03-27 22:39:59

RaZgRiZ
Moderator

Re: Use key by location. Different keyboard layouts.

mash wrote:

Well other games just treat the keyboard as qwerty as long as you don't type and that's what I would expect.  The problem is not dvorak. With dvorak I could just rebind everything to the default positions (wich is still a lot of work) but with the programmer dvorak keyboard layout I don't have numbers! Well I have them if I press shift but there're a lot of keys which I can't bind because they got no name. For example I can't bind the left curly brace { http://programmer-dvorak.appspot.com/im … Dvorak.png

Indeed, the keymap makes no mention of the curly braces in the SDL binds. Your keyboard is a pretty uncommon one. I should also note that you're supposed to bind the secondary characters of a key, but rather the primary ones. In your case i assume the numbers are primaries and the symbols below them secondaries.

Offline

#5 2015-03-28 05:41:03

chasester1
Member

Re: Use key by location. Different keyboard layouts.

look at the keybind config, i presume if you figure out what the key code is for them you can link that keycode to the sdl listener using what ever name you want.

See keymap.cfg

keymap code alias
bind "alias" (command)

you can get the key code number by using http://www.w3schools.com/jsref/tryit.as … ey_keycode

just take that number and add to the keymap config ex:
"{" = 123
so in keymap config add keymap 123 "CURLY_OPEN"
bind "CURLY_OPEN" ( echo "OMG IT WORKS" );


chasester

you may find they are already defined then you can just change the name or just use the current name

Last edited by chasester1 (2015-03-28 05:41:56)

Offline

#6 2015-03-28 14:33:49

mash
Member

Re: Use key by location. Different keyboard layouts.

Thanks chasester1. @RaZgRiZ no binding secondary key doesn't work.
Anyway the question still remains will this ever be implemented as I explained.

Expected behavior: Use the qwerty keyboard layout except when the user is typing then use the selected keyboard layout.
Current behavior: Use the primary keyboard layout except when the user is typing then use the selected keyboard layout.

Furthermore: the primary keyboard layout = the system default keyboard layout and not the selected keyboard layout.

Last edited by mash (2015-03-28 14:34:20)

Offline

#7 2015-03-30 05:23:47

chasester1
Member

Re: Use key by location. Different keyboard layouts.

I mean you could just write your own keymap.cfg. I assume that your keyboard is sending the stadard code say:
you press d but you want that to be o (like in your chart) NOTE: this only works with the bind system if you type into the consol you will have to change the binds manually;

keymap 100 "O"


So when you:

bind "o" "echo hello"

it will let you hit O or D (obiviously you would just switch them around to what ever order)

but i assume you want to type in whatever keyboard you had listed so:

in theory you could just simply write a "translator" so say you want to type: so you would type yo (tr in your layout)
yo command arg1 arg2 arg3 etc

so when you type it, it would look like jibberish but you could still exec it

yo = [
translate
say (concatword "/" $translated )
]
so it would show up in your consol translated after the first enter and then you could just hit enter again. Not super hard to code.

Alternatively you could change the inputs in the source tho i beleive that is buried deep

Offline

#8 2015-03-30 21:26:56

mash
Member

Re: Use key by location. Different keyboard layouts.

-.- yes chasester1 I understood ages ago but that's not the point. Because this current behavior should not be intended.

Offline

Board footer