Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some media keys are mapped wrong #72

Open
rorgoroth opened this issue Oct 22, 2021 · 10 comments
Open

Some media keys are mapped wrong #72

rorgoroth opened this issue Oct 22, 2021 · 10 comments

Comments

@rorgoroth
Copy link

Hi,

On my keyboard I have volume up and down, on F5 F6, you press FN to use the keys as F5 F6.

In game, pressing volume_down key crouches, so I test in the controls and here is the results:

volume_down(E0_2E) registers as "c"
volume_up(E0_30) registers as "b"
volume_mute(E0_20) registers as "d"

All normal keys work, but the F*/Funtion keys are all messed up.

@ensiform
Copy link
Member

ensiform commented Oct 22, 2021

Which platform, if Windows does the same issue appear in original ET.exe.

If Linux/SDL does it happen on ETL? And if linux are you using a self compile with or without SDL active.

Keyboard language/layout? In-game cl_language?

@rorgoroth
Copy link
Author

This is on Windows, my keyboard is en_GB and in game is English (0)

It happens in original et.exe but is fixed in etl.exe

@ensiform
Copy link
Member

Then ETL only fixed it by using SDL on Windows and will be more complicated to track the windows fix down.

@ensiform
Copy link
Member

ensiform commented Oct 22, 2021

Are you knowledgeable to make a build for yourself? I have a way that helps diagnose the keys but I do not wish to turn it on globally for all users in pre-built bins if possible to avoid.

https://github.com/etfdevs/ETe/blob/master/src/win32/win_wndproc.c#L1035

Uncommenting this line should give some data to help look further for when pressing those keys.
As I am on Linux and not windows I cannot reproduce the issue locally.

@rorgoroth
Copy link
Author

rorgoroth commented Oct 22, 2021

Well, maybe it's not worth chasing - it's really a minor annoyance more than anything.

I did try as you suggest:

k+ wParam:000000ae lParam:012e0001
k+ wParam:000000af lParam:01300001

First is vol_down(f5) and second vol_up(f6)

@ec-
Copy link
Collaborator

ec- commented Oct 22, 2021

Add at following line https://github.com/etfdevs/ETe/blob/master/src/win32/win_wndproc.c#L336

Com_Printf( "key: 0x%08x mod:%i ext:%i res:%i(%02x) vkey=%i scan=%i\n", key, modified, is_extended, result, result, nVirtKey, MapVirtualKey( nVirtKey, MAPVK_VK_TO_VSC ) );

@rorgoroth
Copy link
Author

Add at following line https://github.com/etfdevs/ETe/blob/master/src/win32/win_wndproc.c#L336

Com_Printf( "key: 0x%08x mod:%i ext:%i res:%i(%02x) vkey=%i scan=%i\n", key, modified, is_extended, result, result, nVirtKey, MapVirtualKey( nVirtKey, MAPVK_VK_TO_VSC ) );

No change unfortunately, same output.
It's strange because just trying now, the brightness keys don't register at all.

The same happens in q3e though, but with the difference that volume control comes up on the screen as expected even though it still makes you crouch.

@ec-
Copy link
Collaborator

ec- commented Oct 22, 2021

No change unfortunately, same output

Did you recompiled it? Output should provide more info than before

@rorgoroth
Copy link
Author

Yes, just that I'm an idiot and put them in my normal game dir rather than the test one. Here is output I press keys in this order: vol_down, vol_up, c, b

k+ wParam:000000ae lParam:012e0001
key: 0x012e0001 mod:46 ext:1 res:99(63) vkey=174 scan=46
key: 0xc12e0001 mod:46 ext:1 res:99(63) vkey=174 scan=46

k+ wParam:000000af lParam:01300001
key: 0x01300001 mod:48 ext:1 res:98(62) vkey=175 scan=48
key: 0xc1300001 mod:48 ext:1 res:98(62) vkey=175 scan=48

k+ wParam:00000043 lParam:002e0001
key: 0x002e0001 mod:46 ext:0 res:99(63) vkey=67 scan=46
key: 0xc02e0001 mod:46 ext:0 res:99(63) vkey=67 scan=46

k+ wParam:00000042 lParam:00300001
key: 0x00300001 mod:48 ext:0 res:98(62) vkey=66 scan=48
key: 0xc0300001 mod:48 ext:0 res:98(62) vkey=66 scan=48

@ensiform
Copy link
Member

Well just from that it appears scancodes for volume match the character scan codes.

@ensiform ensiform added this to To do in Progress Tracking Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants