feat: add a runtime GUI with iced
Add a GUI! Current visuals:
- active layer
- active vkeys
- zippychord help
Compile it yourself with --features iced_gui. Only tested on Windows but theoretically cross-platform since the iced crate should be. Maybe need to select other features in other OS', e.g. X vs. wayland features in Linux; I'm not sure.
Nice!! I was experimenting for a while with implementing something like MouseLess with an Iced GUI: An overlay with key-abbreviated rectangles on the screen, where pressing two keys in sequence makes the mouse jump to the rectangle with these two keys. I went with a TCP server, but having an Iced GUI built-in might make this much easier to implement.
Do you think this feature could be used for something like that, or do you have other, incompatible plans for it?
I don't have many big plans for the GUI, so I'm open to anything. The main motivation was to help myself remember new zippychords, but adding a new modes like a mouse mover sounds interesting, and there has been requests for something like warpd in the past. Looks like there are already Windows alternatives though, interesting! E.g. TPMouse.
The communication is still implemented via TCP because something in iced causes LLHOOK to not receive events when the GUI is in focus, so the GUI needs to run as a subprocess.
I can confirm that the GUI shows on Mac OS, nice!! 👍
Reminder to self that I want to add clipboard info to the UI
Very cool, especially if this could be used for some which-key like feature where you get a popup showing you which keys do which action, but only after a delay mid-sequence, so that if you forget that your ⎇a x types symbols ✗ ⎇a p types §, you can get immediate contextual help, but otherwise if you don't forget and continue to type, nothing is shown.
By the way, how did you find the performance like? I did a brief test of many of these new great x-platform gui frameworks (egui/slint/iced/makepad/rui/dioxus/vizia), and all of them had a very slow startup on Windows (e.g., ~0.2sec for a "native winapi" hello-world-1-button app) vs ~1–2 secs (ICED was one of the slowest, seems to be a known issue https://github.com/iced-rs/iced/issues/615), so used the native framework for the Windows tray icon