|
|
You can't convert between enums (which is how the keys are defined in fltk-rs) and ints so I've reported it as a bug and asked the maintainer to add Key::F1 etc.
Thanks.
On Tuesday, November 30, 2021 at 2:03:10 PM UTC Albrecht Schlosser wrote:
On 11/30/21 2:42 PM 'Mark' via fltk.general wrote:
> At the moment I have this (using the rust bindings):
> ```rust
> main_window.handle(move |_, event| match event {
> fltk::enums::Event::KeyUp => {
> match fltk::app::event_key() {
> // TODO | F1
> fltk::enums::Key::Help => sender.send(WindowAction::Help),
> _ => {}
> }
> false
> }
> _ => false,
> });
> ```
> But I can't figure out what I need to do to detect F1.
I can't speak for the Rust bindings, but in C++ you would use 'FL_F+n'
for Fn where 'n' is a numeric value, hence F1 would be FL_F+1.
Key values are defined in FL/Enumerations.H, specifically here:
https://github.com/fltk/fltk/blob/36af6a57295a5f3c674134cab60dc644c96e97fa/FL/Enumerations.H#L477
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/6f851ee9-27ac-4abf-9315-f9a7f3268df3n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |