You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hellow
I am attempting to add support for graphic tablets as an input method in ManimGL. While tablet events (e.g., pen pressure, tilt) are successfully captured in a standalone Pyglet window, I am unable to capture these events within the ManimGL window.
It seems that ManimGL's custom window or event loop configuration might be interfering with the propagation of tablet-related events.
Working Example
Below is a working example using a standalone Pyglet window to capture tablet input events.
import pyglet
# Create a resizable window for the whiteboard
window = pyglet.window.Window(800, 600, "Whiteboard", resizable=True)
def on_enter(cursor):
print(f"Cursor entered: {cursor}")
def on_leave(cursor):
print(f"Cursor left: {cursor}")
def on_motion(cursor, x, y, pressure, tilt_x, tilt_y, rotation):
if pressure > 0.2: # Only log events with significant pressure
print(f"Motion detected - x: {x}, y: {y}, pressure: {pressure}, tilt: ({tilt_x}, {tilt_y}), rotation: {rotation}")
tablets = pyglet.input.get_tablets()
if tablets:
tablet = tablets[0]
tablet = tablet.open(window)
tablet.event(on_motion)
tablet.event(on_enter)
tablet.event(on_leave)
else:
print("No tablet device found. Please connect a tablet.")
pyglet.app.run()
Non-Working Example
Below is a non-working example where tablet events are not captured in a ManimGL-based window.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hellow
I am attempting to add support for graphic tablets as an input method in ManimGL. While tablet events (e.g., pen pressure, tilt) are successfully captured in a standalone Pyglet window, I am unable to capture these events within the ManimGL window.
It seems that ManimGL's custom window or event loop configuration might be interfering with the propagation of tablet-related events.
Working Example
Below is a working example using a standalone Pyglet window to capture tablet input events.
Non-Working Example
Below is a non-working example where tablet events are not captured in a ManimGL-based window.
Beta Was this translation helpful? Give feedback.
All reactions