FLTK logo

[fltk.general] Re: Can Fl::event_text() be used for non-text keys?

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: Can Fl::event_text() be used for non-text keys? Manolo May 17, 2021  
 

On Monday, May 17, 2021 at 9:57:11 AM UTC+2 pvr...@btinternet.com wrote:
On my lap-top, the up/down/left/right keys are shared with PgUp/PgDn/Home/End functions. Some apps allow me to use Alt-R to select the second set of functions and I have coded that in my app using Fl::event_key() to detect I am holding Alt-R down while pressing the navigation key. Is there a way to use event_text() instead?

You should explore this question with the test/keyboard program built when building the FLTK library.
That program shows the effect of pressing any key on Fl::event_key(), Fl::event_text() and Fl::event_state().
You'll see that arrow and page keys don't put anything in Fl::event_text().

The OS, not FLTK, is responsible for attaching 2 effects behind a single key. On my
keyboard, pressing the "up arrow" key produces Fl::event_key() = FL_Up
while pressing "function" and the "up arrow" keys simultaneously produces Fl::event_key() = FL_Page_Up.
FLTK perceives the second situation exactly as with an extended keyboard equipped with 2 distinct keys.

Anyway, you should use Fl::event_state() to check for modifier keys (alt, ctrl, shift), not Fl::event_key().

--
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/eb232bd4-1e0b-4403-bb3f-50943db28c03n%40googlegroups.com.
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'.