slint icon indicating copy to clipboard operation
slint copied to clipboard

compiler: Have a `key-sequence` type

Open hunger opened this issue 5 months ago • 3 comments

... which is lowered to a string for now.

Add a new type keyboard-shortcut, that is parsed from @keys(shift + control + a) and gets lowered to a string in Rust and C++ and the interpreter for now.

hunger avatar Jul 11 '25 17:07 hunger

I wanted to keep this unmerged for the time being and build on top of this PR.

hunger avatar Jul 21 '25 11:07 hunger

Newest version now accepts keys from the Keys namespace. To match up with what is defined in there, I also renamed the modifiers to start with uppercase characters. I have ignored the right-side variant of the modifier keys for now.

hunger avatar Jul 28 '25 16:07 hunger

A bit of progress was made:

  • Old branch: Rebased the entire thing on top of current master
  • New commit: Printing was fixed to match inputs better (should be squashed)
  • New commit: Add a KeyboardShortcut struct to the builtin structs and expose that to Slint
    • Rust works
    • C++ still converts to a string somewhere and fails, should be easy to fix though
    • Python and JS is untested so far

hunger avatar Aug 19 '25 07:08 hunger