FLTK logo

Re: [fltk.general] Re: Losing keyboard input under user 'spamming' input

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: Re: Losing keyboard input under user 'spamming' input Albrecht Schlosser Sep 24, 2021  
 
On 9/24/21 2:03 PM rs wrote:
Thanks for the suggestions, Ian.

FYI, the first managed to avoid the issue entirely (albeit with the 0.2 second delay). The second still causes the keyboard events to fall over if the button is held down long enough.

I'm late to the party, but anyway... I tried the original test program on my Linux Mint 20 system and didn't see any issues. It seems to toggle the 2nd window as expected.

My assumption was that the FL_ALT state might get lost when switching windows (IIRC only the last key pressed and held - i.e. the 's' key - gets the key repetition events) but this didn't seem to affect the test.

My next suspect was the shown_v variable. What if the variable and the actual state of the window get out of sync due to the delay induced by the X window server turnaround needed to show the window? So I used the shown() method instead, but this didn't change anything.

Anyway, I attach my modified version of the original test program. Can you please build this and run it on your system? Maybe this can give some clues...

Here's a typical output on my system:

  1 - toggle_win, shown() = 0
  1 - FL_ALT is on , key = 's', shown = 1
  2 - toggle_win, shown() = 0
  3 - toggle_win, shown() = 1
  4 - toggle_win, shown() = 0
  5 - toggle_win, shown() = 1
  6 - toggle_win, shown() = 0
  2 - FL_ALT is on , key = 's', shown = 1
  7 - toggle_win, shown() = 0
  8 - toggle_win, shown() = 1
  9 - toggle_win, shown() = 0
  3 - FL_ALT is on , key = 's', shown = 1
 10 - toggle_win, shown() = 0
...
511 - toggle_win, shown() = 1
512 - toggle_win, shown() = 0
513 - toggle_win, shown() = 1
514 - toggle_win, shown() = 0
183 - FL_ALT is on , key = 's', shown = 1
515 - toggle_win, shown() = 0
516 - toggle_win, shown() = 1
517 - toggle_win, shown() = 0
184 - FL_ALT is on , key = 's', shown = 1
518 - toggle_win, shown() = 0
185 - FL_ALT is on , key = 's', shown = 1
519 - toggle_win, shown() = 0

As you can clearly see 'toggle_win' (the menu callback) runs much more often than the event handling of the derived window class, which is to be expected because of the X server turnaround needed to effectively show/hide the window.

However, in my test everything works as expected (as far as user input and the show/hide toggling is concerned).

It would be interesting to see what happens on your system with this program. Can you please test and report?

--
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/9bdebcc2-8624-17fd-e216-3b60300b5e88%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'.