[Bf-funboard] Re: QKEY Functionality

Robert Wenzlaff bf-funboard@blender.org
Thu, 23 Oct 2003 00:55:37 -0400


On Wednesday 22 October 2003 14:37, Guillermo S. Romero / Familia Romero 
wrote:
> It is not cross plataform, Mac is Command Q (they left Control for
> console and also cos it is weird placed, in opinion of heavy control
> users). Blender is not QKEY, it is QKEY or any combination with q
> (anybody cared to test it?), then click or Enter.


Yeah, Bleder does this with a lot of keys.  This kinda' crosses over into 
coders list, but here it is anyway.  The code is currently set up like:

case KKEY:
	if (G.qual & LR_SHIFTKEY) do_this();
	else if  (G.qual & LR_ALTKEY) do_that();
	else do_the_other();
	break;

Which means K and CTRL-K fall through to the else.

That's kind of confusing for the beginner, since half the users remember the 
CTRL-K and half the K, and communication gets weird.   If CTRL-K is not 
defined, then it should do nothing.  We should make it a point in the code to 
make sure we explicitly require a specific key.   The above should be:

case KKEY:
	if (G.qual & LR_SHIFTKEY) do_this();
	else if  (G.qual & LR_ALTKEY) do_that();
	else if (G.qual & LR_CTRLKEY) break; /* unused key placeholder */
	else do_the_other();  		
	break;

Though it gets complicated when you factor in multiple qualifiers.  In the 
above CTRL-SHIFT-K triggers the do_this().

Maybe a set of macros is needed to clean this all up.  We could do all the 
combos like:

#define LR_CTRL ( (G.qual & LR_CTRLKEY) && !(G.qual & LR_SHIFTKEY) && !(G.qual 
& LR_ALTKEY) )

#define LR_SHIFT_CTRL ( (G.qual & LR_CTRLKEY) && (G.qual & LR_SHIFTKEY) && 
!(G.qual & LR_ALTKEY) )

etc., (looking up the constants if need be,  I can't recall if a #define can 
be used in a #define),  then :

if (LR_SHIFT) do_this();

is triggered only on Shift. (And personally I don't think we now, or should 
ever differnetiate between Left and Right mod keys, so if could be just CTRL.
-- 
**********************************************************
Robert Wenzlaff                rwenzlaff@soylent-green.com