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

VKeyboard: on_key_up e on_key_down #6072

Open
excript opened this issue Dec 10, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@excript
Copy link

commented Dec 10, 2018

If you touch in a button from Keybord, the event on_key_up is work, but on_key_down just work in a little be keys.

class VkeyboardApp(App):

    def key_down(self, *largs):
        print("key_down")

    def key_up(self, *largs):
        print("key_up")
        # print(keycode)

    def build(self):

        self.vk = VKeyboard(layout='qwerty')

        self.vk.bind(on_key_down=self.key_down)
        self.vk.bind(on_key_up=self.key_up)

        return self.vk

VkeyboardApp().run()
@Sires0

This comment has been minimized.

Copy link

commented Feb 7, 2019

Not sure but doesn't seems like a bug, seems more like lack of documentation, not sure why but(from what I understood in the code) if the window is SDL2 then it will emit a on_textinput event.

Maybe you could try self.vk.bind(on_textinput=self.key_down) or something.

Also it wont dispatch the object, b_keycode, internal and b_modifiers like it happens on on_key_down, but it will dispatch only the object and the internal(a string with the key).

Btw I love ur tutorials :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.