FLTK logo

Re: [fltk.general] How do I detect an F1 keypress?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: How do I detect an F1 keypress? Albrecht Schlosser Nov 30, 2021  
 
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/263c3b94-26c2-f1e3-ddfd-5e5d4c804f8c%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.