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

raw keyboard events are send repeatedly #874

Closed
blaireau-code-with-panda3D opened this issue Feb 29, 2020 · 0 comments
Closed

raw keyboard events are send repeatedly #874

blaireau-code-with-panda3D opened this issue Feb 29, 2020 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@blaireau-code-with-panda3D
Copy link

@blaireau-code-with-panda3D blaireau-code-with-panda3D commented Feb 29, 2020

When I capture keyboard events, the events prefixed with "raw-" are send repeatedly while I hold the corresponding key. I think the right name for the keyboard autorepeat should be something like "raw-q-repeat".
Here is an example of code :

from direct.showbase import DirectObject
from direct.showbase.ShowBase import ShowBase


class App(ShowBase, DirectObject.DirectObject):

    def __init__(self):
        super().__init__()
        self.accept("raw-q", self.do_something)
        self.number = 0

    # Press the key corresponding to 'q' on a qwerty keyboard and hold it
    # do_something get called several times
    def do_something(self):
        print("Call do_something for the {} time.".format(self.number))
        self.number += 1

app = App()
app.run()
@rdb rdb self-assigned this Feb 29, 2020
@rdb rdb added the bug label Feb 29, 2020
@rdb rdb added this to the 1.10.6 milestone Feb 29, 2020
@rdb rdb closed this in 3963c5d Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.