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
It's been on my 'would be nice, but don't have time' list for years. Glad to see you've got it working!
I recognize this may be intended as a proof of concept project; however, was hoping to run this in a native Wayland environment. Unfortunately, though latency looks good in your vid, TK doesn't appear to support Wayland.
What steps would be needed to integrate an alternative canvas that can run on Wayland? Happy to test and/or get some work started if you might have some tips on where to start bzw. the python script
Well, thanks for your interest! To be honest, I've never used Wayland before, and sooner or later switched all my systems to X11 (nvidia drivers, xfce, forced hdmi resolution in xorg.conf, ...) because as a user I could never be bothered by the differences, so this is quite new to me
What it does is draw dots on mouse events and store (x, y, time) tuples into the global_strokes list we later pass to predict()
global_strokes= [
[(x, y, t), (x, y, t), (x, y, t), ...], # first stroke between pen down and up
[(x, y, t), (x, y, t), (x, y, t), ...], # second stroke# ...
]
So any canvas widget we can get these coordinates from could be used.
At the moment the predict() function still gets passed a tkinter text widget (prediction_field) into which it writes the recognized text, but this can easily be removed - it is already returning the text as a string either way.
inkpad.py obviously needs to be rewritten, but the detection stuff should be just fine.
Jus the drawing part, no recognition is implemented there.
However, I couldn't figure out how to make the window stay in the foreground and not get focus, since there is no override redirect that can be used. That makes it unusable, at least under GNOME.
Activity
s12wu commentedon Dec 6, 2024
Well, thanks for your interest! To be honest, I've never used Wayland before, and sooner or later switched all my systems to X11 (nvidia drivers, xfce, forced hdmi resolution in xorg.conf, ...) because as a user I could never be bothered by the differences, so this is quite new to me
The actual canvas is handled by a class Sketchpad, inherited from tk.Canvas in https://github.com/s12wu/OnlineHTR/blob/main/src/data/acquisition.py#L132.
What it does is draw dots on mouse events and store (x, y, time) tuples into the global_strokes list we later pass to predict()
So any canvas widget we can get these coordinates from could be used.
At the moment the predict() function still gets passed a tkinter text widget (
prediction_field) into which it writes the recognized text, but this can easily be removed - it is already returning the text as a string either way.inkpad.py obviously needs to be rewritten, but the detection stuff should be just fine.
s12wu commentedon Dec 13, 2024
Just to be sure, a GTK3/4 ui would do the job?
s12wu commentedon Dec 28, 2024
So I tried to recreate the tkinter UI in gtk4: https://github.com/s12wu/inkput/blob/gtk/gtk_ui.py
Jus the drawing part, no recognition is implemented there.
However, I couldn't figure out how to make the window stay in the foreground and not get focus, since there is no
override redirectthat can be used. That makes it unusable, at least under GNOME.