![]() |
SDL apps do not accept Fn key combos on N810
My tested SDL apps do not accept Fn key combos on N810
This pretty much cripples dosbox and any game requiring numeric input. Have I overlooked something? If anyone has a clue how to fix, please post here. If/when I find a solution i'll do the same. Cheers. ------------------------ edit; incorrect. some sdl apps do accept fn key - gemrb works - when it accepts keyboard input at all. |
Re: SDL apps do not accept Fn key combos on N810
Did you ever figure out why some do and some do not?
One I am trying to port now needs the number keys and does not accept fn keys. If there is something simple I can do to make it work with the fn key I would rather that than say remap the responses from numbers to q w e r t y and try to remember that q = 1 and w = 2 and such... Thanks! -John |
Re: SDL apps do not accept Fn key combos on N810
You need to call SDL_EnableUNICODE(1) at runtime. Both keys (fn+key) need to be pressed though.
|
Re: SDL apps do not accept Fn key combos on N810
Quote:
Is there some example code I can peek though that uses this call to give me an idea where it should be put? My own thought was right here... Code:
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, Thanks again -John "Strugglin' through it just because it's fun" Tobias |
Re: SDL apps do not accept Fn key combos on N810
sorry for confusion, what i meant is that it is method call not some compile time value to #define. The gotcha is probably that you are reading keycodes from keysym.sym field, the translated value is in keysym.unicode field.
here is some random example Code:
#include <stdio.h> Press:- Scancode: 0x1C, Name: t keysym 0074 t , Unicode: 5 (0x0035) |
Re: SDL apps do not accept Fn key combos on N810
It is a bit confusing but it makes sense. SDL is too low level. Since you really press fn and t keys you always get keycodes for fn and t. The enable unicode part enables additional calls inside SDL to translate those raw keys according to current keyboard mapping. it is same like shift + a, you get keycodes for shift and a and this translates into upppercase A
|
Re: SDL apps do not accept Fn key combos on N810
That does make sense and in looking at the code it is:
Code:
switch (event.key.keysym.sym) { so, it isnt, of course, checking unicode. That means a bit more tweaking in order to get it working. Thanks for all the information you explained it perfectly. Course while testing this I also came to the conclusion that the mouse isnt working either. I mean, there is a pointer, and it moves to where you click, however it doesnt 'read' the click and do anything with it. I am going to leave that until I get everything else working because you CAN play the game completely without using the mouse if you remember all the shortcut keys (t = talk, a = attack etc.) So if I can get all the keys working then the mouse is far less important. (well except for N800 users..) but I will fix that eventually (well I hope I will, this crash course on SDL has been enlightening. to say the least.) Thanks again, -John |
Re: SDL apps do not accept Fn key combos on N810
Quote:
I can not thank you enough for your patient instruction and help. Thanks, -John |
Re: SDL apps do not accept Fn key combos on N810
fanoush,
I have this working pretty good, however I think I need to change something else. I think, while I am catching the fn+ keys properly, I am now loosing normal keys in some instances. is there a check I need to preform or a different way to identify normal keys (the arrow keys for example up, down left right) while using keysym.unicode instead of keysym.sym? When in the gui now (where I am actually using the unicode) I can use fn+ but I can not use the arrow keys to select a different toon for leader. While it isnt a huge deal, you can use the keyboard shortcut L for this, I would rather have it working correctly you know? Anyway I didnt change anything else, just added unicode on keysym. Thanks, -John |
Re: SDL apps do not accept Fn key combos on N810
you may try to fallback to use keysym.sym if keysym.unicode value is zero
|
All times are GMT. The time now is 10:53. |
vBulletin® Version 3.8.8