Author Topic: Keyboard Layouts  (Read 8206 times)

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« on: August 08, 2007, 01:53:26 pm »
Unfortunatly, not everyone has the standard US keyboard. Even more unfortunate is that Tremulous believes that it is a standard US keyboard connected to the computer, even if it is a French one, Norwegian, Portuguese, or anything else. There is a large group f computers which (for example) have the Z and Y swapped (and therefore have the Y after the T and the Z before the X), and I happen to have one of those keyboards.

When I play, if I press my "Z" key (which is the the place of the "Y" key), I can start teamchatting, however, in my autogen.cfg and autoexec.cfg the Y key is bound to teamchat, thus proving that the game thinks I'm inputing on a US keyboard and therefore believe it's a Y. Although it isn't a big problem with just the Z-Y swap, it gets much more complicated when you look at the punctuations and special characters. Strangely, in the console and when I am typing in the chat, the game wil recognise my keyboard and if I press Z, it recognises it as a Z.

In addition to those problems, if I want to edit my autoexec.cfg file, WordPad knows I have Swiss keyboard, and therefore when I press my Z key, it will actually insert a Z, but in the game, it will believe it's a Y which are in very different places on the keyboard and can be very frustrating when editing things manually.

I was wondering if there is a way to change the ingame keyboard layout settings to Swiss or whatever keyboard layout you have instead of US, and if this isn't possible, how can I avoid this problem?

PS: A list of different keyboard layouts can be found here

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Keyboard Layouts
« Reply #1 on: August 08, 2007, 07:52:43 pm »
Originally, Quake 3 shipped to multiple countries and each one had a different default keyboard layout to fit non-US keyboards.

Tremulous is not even a commercial game. Keep that in mind.

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« Reply #2 on: August 09, 2007, 10:45:30 am »
ehmm, I know of another game which is in pre-alpha stage, and there are no problems with the different keyboard layout. Tremulous is at version 1.1.0 and it can't even support different keyboard layouts. Anyway, I didn't ask if Tremulous is a commercial game, and I know it is not a commercial game, however this does not mean that the game has to be crap or that it cannot contain some features.

I asked if it is possible to change what keyboard layout Tremulous think I have to what I actually have, and if this isn't possible, is there a way to avoid this problem?

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Re: Keyboard Layouts
« Reply #3 on: August 09, 2007, 10:59:01 am »
Quake 3 on Linux is keymap dependent (and I'd kill to make Enemy Territory keymap independent :roll:).

Quote from: "Josellis"
In addition to those problems, if I want to edit my autoexec.cfg file, WordPad knows I have Swiss keyboard...


Please don't use that piece of crap. PSPad is way better, even for a VI user like me.

Funny note: Czech pronunciation of "wordpad" is similar to pronunciation of "odpad", which means garbage in Czech. I think it's too accurate description to be just a coincidence :D
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« Reply #4 on: August 09, 2007, 11:04:59 am »
lol, btw, wordpad works just fine for what I want. Anyway, you say  Quake 3 is keymap dependent, but can't you change what keymap it depends on?

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Keyboard Layouts
« Reply #5 on: August 09, 2007, 11:06:11 am »
Quote from: "Josellis"
lol, btw, wordpad works just fine for what I want. Anyway, you say  Quake 3 is keymap dependent, but can't you change what keymap it depends on?


It's keymap dependent on Linux. Windows version reads system scancodes directly instead.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« Reply #6 on: August 09, 2007, 11:09:03 am »
Quote from: "next_ghost"
Windows version reads system scancodes directly instead.


hmmm, I'm not a programmer and I don't go much into the technical side of things unless I have to, and what you just said doesn't make any sense for me.

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Keyboard Layouts
« Reply #7 on: August 09, 2007, 11:39:09 am »
Basically you should change the key maps to be suitable for your keyboard and layout. If you had a keyboard that has the WASD keys scattered and the QPMZ keys in place, and you are already used to typing on that keyboard, then you would have binding like /bind Q +forward;bind P +back; and so on.

Or if you absolutely want to stick with the default for some reason, you may switch to the US keyboard layout (in your operating system).
Quote from: "next_ghost"
It's keymap dependent on Linux. Windows version reads system scancodes directly instead.
I don't know what that means, lol, but if you meant that changing they keyboard layout in Windows does not alter the keys for a specific action, then you are wrong.

Note: only noobs use the default keyboard settings.

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Keyboard Layouts
« Reply #8 on: August 09, 2007, 11:58:38 am »
Quote from: "/dev/humancontroller"
I don't know what that means, lol, but if you meant that changing they keyboard layout in Windows does not alter the keys for a specific action, then you are wrong.


Orly? What's s_scantokey and MapKey() in src/win32/win_wndproc.c for then? :roll:
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Keyboard Layouts
« Reply #9 on: August 09, 2007, 12:48:46 pm »
Quote from: "next_ghost"
Quote from: "/dev/humancontroller"
I don't know what that means, lol, but if you meant that changing they keyboard layout in Windows does not alter the keys for a specific action, then you are wrong.


Orly? What's s_scantokey and MapKey() in src/win32/win_wndproc.c for then? :roll:

For show.

Actually, looking into it reveals that MapKey() converts from ASCII to keyNum_t (so that you can't press 0x01 for example, to avoid bugs).

MapKey() gets its key parameter from MainWndProc's lParam parameter. MainWndProc is called by the OS. I don't know about your Windows XP [lol edition?], but on my Windows XP, changing the key layout causes the lParam to be changed accordingly.

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Keyboard Layouts
« Reply #10 on: August 09, 2007, 01:17:21 pm »
Quote from: "/dev/humancontroller"
For show.

Actually, looking into it reveals that MapKey() converts from ASCII to keyNum_t (so that you can't press 0x01 for example, to avoid bugs).

MapKey() gets its key parameter from MainWndProc's lParam parameter. MainWndProc is called by the OS. I don't know about your Windows XP [lol edition?], but on my Windows XP, changing the key layout causes the lParam to be changed accordingly.


If you were right, s_scantokey would copy ASCII table, not QWERTY keyboard layout. wParam is the keycode from system keymap, lParam contains low-level system scancode and other info about they key pressed. And BTW, I don't use Windows.

http://msdn2.microsoft.com/en-us/library/ms646280.aspx

WM_KEYDOWN Notification

Parameters

    wParam
        Specifies the virtual-key code of the nonsystem key.
    lParam
        Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table.

        0-15
            Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
       16-23
            Specifies the scan code. The value depends on the OEM.

        24
            Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
        25-28
            Reserved; do not use.
        29
            Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
        30
            Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
        31
            Specifies the transition state. The value is always zero for a WM_KEYDOWN message.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« Reply #11 on: August 09, 2007, 01:38:37 pm »
Sorry, but I just got totally confused

As I said previously, I am not into all the programming and stuff.

Now, the problem is not in the fact that default keyboard setting are just scattered around the keyboard (like having WASD shuffled), but that the game isn't actually recognising my keystrokes as what they should be, for example, if I press Z on my keyboard, the game believes it is a Y and starts teamchatting, but when you go into punctuation, it becomes much harder to deshuffle everything, and in addition, they are some keys where are on the Swiss keyboard which aren't on the US keyboard.

All I want are instructions on how to change the keyboard settings, and what are those scancodes everyone keeps talking about?


And sorry for the inconveniences

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Keyboard Layouts
« Reply #12 on: August 09, 2007, 02:17:39 pm »
Quote from: "Josellis"
All I want are instructions on how to change the keyboard settings,


The lazy way: File a bug report to ioQ3 bugzilla and pray somebody will get bored enough to fix it.

The hard way: Download Tremulous source codes, open src/win32/win_wndproc.c, go to line 120 and change the letters in the table to copy your native keyboard layout. Then compile your own tremulous.exe and play with that one.

Quote
and what are those scancodes everyone keeps talking about?


Scancode is a number that describes a key on your keyboard. When you press a key, Windows read the corresponding number, use it as an index into keymap table and find out what should that key do.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

/dev/humancontroller

  • Posts: 1033
  • Turrets: +1002/-383
Keyboard Layouts
« Reply #13 on: August 09, 2007, 02:29:30 pm »
Should have double checked before writing anything too smart. It DOES depend on the OEM. :) I checked, only the character typing (console, chat, ...) changed. Maybe I was playing on Linux when changing the layouts changed the game key layouts too (I just don't remember). Well, character input is different from dinput.

And Josellis, don't mind us, it's an advanced topic. I think this is what you're looking for: write these command in the console:
Code: [Select]
/bind z "messagemode2"
/unbind y
To swap x and y.

Josellis

  • Posts: 43
  • Turrets: +0/-0
    • http://planeart.byethost7.com
Keyboard Layouts
« Reply #14 on: August 10, 2007, 01:59:05 pm »
Thank you :)

I have gone for the compiler option, and for me it seems very easy (not much coding involved :)

Anyway, now I have another question, are the following keys bindable in Trem? and if so, what would be their name? (like ; isn't just ";" it is "SEMICOLON"

Code: [Select]
§ ' ^ CAPS_LOCK è ¨ é à $ < Alt_Gr

next_ghost

  • Posts: 892
  • Turrets: +3/-6
Keyboard Layouts
« Reply #15 on: August 10, 2007, 03:39:59 pm »
Quote from: "Josellis"
Thank you :)

I have gone for the compiler option, and for me it seems very easy (not much coding involved :)

Anyway, now I have another question, are the following keys bindable in Trem? and if so, what would be their name? (like ; isn't just ";" it is "SEMICOLON"

Code: [Select]
§ ' ^ CAPS_LOCK è ¨ é à $ < Alt_Gr


Semicolon is a special case because it's used as a command separator in config files. It's not treated as a special key in the code.

Those keys should already be mapped to some virtual keycodes so just backup your config file and bind those keys to something in the in-game options menu.
If my answer to your problem doesn't seem helpful, it means I won't help you until you show some effort to fix your problem yourself!
1.2.0 release's been delayed for 5:48:00 already because of stupid questions.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Keyboard Layouts
« Reply #16 on: August 10, 2007, 04:30:03 pm »
i believe that accented character cause a crash in the 1.1 client (fixing it isn't easy because the svn client no longer works with 1.1, but it is already fixed for 1.2)
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----