Odd behavior with on_key_press

Issue #145 resolved
created an issue

Sometimes when pressing more buttons at the same time, some of them aren't registered before others are released, and sometimes they aren't registered at all.

Broken combinations: Left, up, down A, S, D, F, G

Script used for testing:

import pyglet

window = pyglet.window.Window()

def on_key_press(symbol, modifier):
    print("Key pressed:", pyglet.window.key.symbol_string(symbol))

def on_key_release(symbol, modifier):
    print("Key released:", pyglet.window.key.symbol_string(symbol))


python -m pyglet.info: https://docs.google.com/document/d/1dnG1qbC0icSVeuAOPbTatRyFEiyTfQ1e9jTRgnIWlcI/edit?usp=sharing

Comments (5)

  1. ccanepa

    Not a pyglet developer, but this defect normally comes from limitations in the keyboard hardware.

    This is a direct consequence of how the electrical matrix of switches is wired, which depends in the manufacturer and model.

    Typically it is safe to assume that three simultaneous keys presses will be correctly handled; high end keyboards can handle much more.

  2. Log in to comment