maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   SDL apps do not accept Fn key combos on N810 (https://talk.maemo.org/showthread.php?t=15501)

tobiasj 2009-03-15 19:12

Re: SDL apps do not accept Fn key combos on N810
 
Quote:

Originally Posted by fanoush (Post 271865)
you may try to fallback to use keysym.sym if keysym.unicode value is zero

You are right again, I put this:

Code:

                if (!event.key.keysym.unicode < 0x80 && !event.key.keysym.unicode > 0 ){
                        lotr_keybuffer[lotr_keybufferpos++] =
                        event.key.keysym.sym;
                }


right after and if it wasnt a valid unicode code I diable unicode.

Now you can select the leader using the arrow keys like you are supposed to be able to..

Thanks again,

-John

tobiasj 2009-03-15 21:03

Re: SDL apps do not accept Fn key combos on N810
 
hmmm strange artifact now, if you press any directional arrow to move the toon more than about 3 steps without changing directions or letting off the key and pressing it again it suddenly sends you to the left and no matter what button you press you keep going left until you press left and release it.

I am going to remove the code I just added and see if it goes away. if not then I dont know what caused it. It wasnt doing it yesterday...


-John

Edit: Yes, this code is what is breaking it. so that isnt (obviously) the best way to handle it. It seems to break on the repeated keys. I have to study how repeated keys are handled in SDL and look for a better way to do this.

Edit 2: if I simply do not increment lotr_keybufferpos by removing the ++ everything goes back to normal as if the entire line was not there. no leader select but you can walk without suddenly deciding you really meant to go left... Wonder what the keyboard buffer should be set to. I think it is 16 in the code..

tobiasj 2009-03-16 15:37

Re: SDL apps do not accept Fn key combos on N810
 
Ignore the last few messages please. Thats what I get for trying to code in the middle of the night.

when I diffused the logic bomb that was my code and made it actually make sense it worked SO much better.

It is now functioning properly and as it should have all along.



-John


All times are GMT. The time now is 15:24.

vBulletin® Version 3.8.8