https://github.com/riovan/scroller/blob/master/scroller/player.py This works, but I wish to have a MOD_CTRL thing in KeyStateHandler so I can decrease the speed accordingly if it is not in there in the update function.
On 11/6/15, Leif Theden <leif.the...@gmail.com> wrote: > Could you paste the code you are using? I am confident that I understand > your problem, but seeing some code will help. > > On Thursday, November 5, 2015 at 8:54:20 PM UTC-6, dhruv kumar wrote: >> >> Greetings, >> I've seen that in the on_key_release function, if you add a modifier, >> it doesn't quite work right. for example, I have an on_key_press where >> an arrow key turns something to true whereas releasing it turns to >> false. The ctrl modifier changes my speed. Now, I have to press both >> in conjunction to get it, because when I press ctrl my speed is faster >> but that is meaningless with the is_moving=True variable, which gets >> toggled on by the arrow keys. Now, if I'm pressing ctrl and the arrow >> keys in conjunction, and then I release the arrow keys and then I >> release ctrl, it all works. But if I release ctrl, nothing happens; my >> movement_speed does not get decreased. >> I wanted to ask if modifiers could be added in KeyStateHandler so I >> can check on each tick if the key isn't pressed, and decrease the >> movement speed according. Is this easy to do? >> > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pyglet-users+unsubscr...@googlegroups.com. > To post to this group, send email to pyglet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/pyglet-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To post to this group, send email to pyglet-users@googlegroups.com. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.