Active Topics

 


Reply
Thread Tools
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#11
Originally Posted by fanoush View Post
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's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#12
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..

Last edited by tobiasj; 2009-03-15 at 22:35.
 
tobiasj's Avatar
Posts: 241 | Thanked: 74 times | Joined on Jul 2007
#13
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
 
Reply


 
Forum Jump


All times are GMT. The time now is 10:59.