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

Recorder cannot playback keyboard events #3611

Open
fabiankreutz opened this issue Sep 3, 2015 · 2 comments
Open

Recorder cannot playback keyboard events #3611

fabiankreutz opened this issue Sep 3, 2015 · 2 comments

Comments

@fabiankreutz
Copy link

Try it out with this simple main.py: http://pastebin.com/2aDzfbNr
Record some keypresses (visible in the textinput), play-back and see that the text-input will not receive the keys.

This is very problematic, as it prevents automated testing for me.

One issue is that the recorder uses the **kwargs of the on_keyboard event to produce the event log entry. The three variables (scancode etc) are unnamed, so they come in *args.
I fixed that locally but still:

The second issue is that the played-back events (event when I add scancode and modifier) have no effect on the running app.
The only exception seem to be Esc and Enter.

@fabiankreutz
Copy link
Author

My function in input/recorder.py

def on_keyboard(self, etype, window, key, scancode, codepoint=None, modifier=None):
    if not self.record:
        return
    self.record_fd.write('%r\n' % (
        (time() - self.record_time, etype, 0, {
            'key': key,
            'scancode': scancode,
            'codepoint': codepoint,
            'modifier': modifier,
            'is_touch': False}), ))
    self.counter += 1

@stale
Copy link

stale bot commented Oct 7, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 7, 2017
@KeyWeeUsr KeyWeeUsr removed the stale label Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants