[CinCV TNG] lazy insertion point movement when using keypad
good1.2guy at gmail.com
Wed Aug 9 00:43:00 CEST 2017
Followup to some email:
> Instead of using shift or Keypad0, why not use Num_Lock?
> This would be like: using the Num_Lock key to toggle between behavior
> 1 and behavior 2?
> My first thought was about somehow using the other (unused) keys on
> the keypad for the behavior 2, but mainly because of the special
> behavior of the Num_Lock key this might cause more difficulties than
> it solves problems.
Sorry for the delay in the response, but I really did look around to see
what was possible and would probably work best. Here is what I found:
XKeyEvents have a "Key masks" used as modifier bits,
ctrl_mask = (key_state & ControlMask) ? 1 : 0; // ctrl key down
shift_mask = (key_state & ShiftMask) ? 1 : 0; // shift key down
alt_mask = (key_state & Mod1Mask) ? 1 : 0; // alt key down
While it is true that you can access the num-lock state with XQueryPointer,
the num-lock state affects the way the numeric pad is interpreted by other
applications which may be also in use at the same time. That is not very
convenient... It also depends on the keyboard mapping which may be quite
variable... Some small keyboards may not have num-lock, and the light may or
may not be present. All in all, not my first choice.
The XKeyEvent masks are always there, and have a long term historical
basis, so are likely to work on all X implementations using shift. On all
of my systems
there is a shift key near the the numeric pad anyway - my laptop has it
just as close as the 0 key while the desktop has only a single column
between so it is still easy enough to reach with the right hand. You can
also just use your left hand to use the Shift key on the other side of the
Yea,... anyway... KP4 is now correctly working with the Shift key plus you
can, for example, now switch from KP4 to Shift-KP4 without stopping first.
This has been checked into the Git repository. Give it a try and let us
know what you think.
> The only inconvenience that I currently see, is when I want to change
> the playback speed without interruption while it's already playing.
> but maybe it would be possible that when one of these keys in combination
> with shift or Keypad0 would be used to activate the playback, without it
> being Stopped...
You don't have to worry about blinking and missing anything any more. For
example, press KP3 for playing normal forward, *don't press KP3 to stop*,
just press KP2 to reverse or whatever you want to do next. It does not
miss any frames. This should work for all of the keys along with the new
Shift keys so you can go from KP1 to Shift-KP1 and miss nothing, but now
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Cinelerra