Skip to content

Python input events and sketch folder asset root. - #272

Open
tychedelia wants to merge 1 commit into
mainfrom
py-input
Open

tychedelia wants to merge 1 commit into
mainfrom
py-input

Conversation

@tychedelia

@tychedelia tychedelia commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Bunch of Python input cleanup to get closer to how Processing/py5 do it, plus an asset root change that kept biting
me while porting examples.

  • callbacks can take an event now, e.g. def mouse_pressed(e) or def key_pressed(e). the no-arg versions still
    work, we just check the signature
  • MouseEvent has x, y, button, wheel and KeyEvent has key, key_code
  • added mouse_clicked, key_typed and window_resized
  • dropped the mouse_wheel global since it clashed with the callback of the same name, use e.wheel instead
  • window_x / window_y are just normal globals now instead of the special-cased lookup
  • more key constants (F13-F25, numpad, lock keys, right-hand modifiers)
  • key code conversion was copy-pasted across pyo3, ffi and wasm, moved it into processing_input so there's one
    copy

Also the asset root is now the sketch folder itself instead of <sketch>/assets, so load_image("data/pic.png")
just works like it does in Processing.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Visual regression: 1 changed of 43 cases

case status detail
py_flocking_gpu ❌ changed 7.91% of pixels differ

If these changes are intentional, add the deliberate-rendering-change label.

baseline 56dc3f7d01 · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))

Open the visual report · workflow run

Base automatically changed from py-shader-packages to main November 17, 2026 20:30
@tychedelia
tychedelia requested a review from catilac November 17, 2026 21:50
@tychedelia
tychedelia marked this pull request as ready for review November 17, 2026 21:50

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant