FLTK logo

Re: [fltk.general] What is the right way to do these shortcuts?

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: What is the right way to do these shortcuts? Dave Jordan May 12, 2021  
 


On Wed, May 12, 2021 at 8:59 PM lifeatt...@gmail.com <lifeattickville@gmail.com> wrote:
>Also, I'm not sure you should be doing anything with FL_FOCUS. If you want the cell to light up when you 
>hover over it, use FL_ENTER and FL_LEAVE instead, that might be what you want -- I'm not sure.

A valid point about cell highlighting. But in the OP's pseudo-code there is this section:

case FL_KEYBOARD:
switch(s) {
case S_NORM:{ block-specific vars defined here; if k is alpha {do stuff;cell->redraw();} ...

So FL_FOCUS/FL_UNFOCUS handling is necessary to receive keyboard events.

By not calling FL_BOX::handle() in Cell::handle(), the app/main function is likely not receiving the CTRL+S shortcut 
for the save menu. [Unless my understanding of events is wrong]

Kevin

--

I'm pretty sure i need to grab the focus/unfocus events to correctly color the cells.
both the highlight and the unhighlight colors are supposed to be user options.
also, re FL_KEYBOARD, there's a lot of processing going on in the "do stuff," like keystroke table lookup,
counting vowels entered vs. consonants, some other counting functions...

i'm in the process now of adding the base class handle call to the custom handle, and using ret value.

pretty soon i'm going to post this beast somewhere -- github seems a little over the top for my needs -- if there are any other suggestions I'm all ears.

-dave

--
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/CAPdW6b%2BCi7uhTPyinpp3gXMyejY-BjrESjjK_cyhOOXJ2gHKJg%40mail.gmail.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'.