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

Possible API Enhancements #1

Open
Rami-Sabbagh opened this issue Aug 10, 2021 · 0 comments
Open

Possible API Enhancements #1

Rami-Sabbagh opened this issue Aug 10, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Rami-Sabbagh
Copy link
Owner

  1. Device objects cache: Cache devices objects by device id, so when a device object is requested for the same id, the same reference for an existing one would be returned. This could remove some stress on the garbage collector, and should be possible to be done using WeakMap and maybe Symbol too.
  2. Events pattern: The interception class can be an events emitter, emitting events like:
    • device: After a wait() call.
    • mouse: When the device is a mouse.
    • keyboard: When the device is a keyboard.
    • stroke: When the stroke is received.
    • mouse_stroke: When a mouse stroke is received.
    • key_stroke: When a keyboard stroke is received.
    • mouse_down: When a mouse button is down.
    • mouse_up: When a mouse button is up.
    • mouse_scroll: When a mouse wheel is scrolled.
    • mouse_move: When the mouse moves.
    • key_down: When a key is pressed down.
    • key_up: When a key is released.
    • key_e0: When a special key is pressed down.
    • key_e1: When a special key is released.
  3. Events: Events objects like the DOM ones can be used, with the preventDefault functionality for blocking the whole event and such.
  4. Construction Options: With the events system, it would be nice to have the events filters automatically setup at initialization. It would also be good to add an option for automatically translating e0 and e1 key strokes to up and down.
@Rami-Sabbagh Rami-Sabbagh added the enhancement New feature or request label Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant