[Bf-committers] Configurable keybindings
Wed, 26 May 2004 14:43:43 +0200
> The current definitions for the above these keys is in BKE_global.h
> #define R_SHIFTKEY 1
> #define L_SHIFTKEY 2
> #define LR_SHIFTKEY 3
> #define R_ALTKEY 4
> #define L_ALTKEY 8
> #define LR_ALTKEY 12
> #define R_CTRLKEY 16
> #define L_CTRLKEY 32
> #define LR_CTRLKEY 48
A long long (long) time ago we thought it could be useful to have =20
different left and right shift/alt/control hotkeys. This appeared not =20=
to work, for example:
- for left handed people
- some keyboards don't have all keys
- some OS's (or keyboards, I don't know) have no different events for it
So the distincion can be removed.
> Currently if we can have two modifiers active we do something like
> G.qual =3D=3D (LR_CTRLKEY | LR_ALTKEY)
> which is not switch case friendly, so perhaps have something like
> #define LR_CTRLKEY_AND_LR_ALTKEY
> #define LR_SHIFTKEY_AND_LR_ALTKEY
> #define LR_SHIFTKEY_AND_LR_CTRLKEY
> #define LR_SHIFTKEY_AND_LR_CTRLKEY_AND_LR_ALTKEY
> #define LR_CTRLKEY_OR_LR_ALTKEY
> #define LR_CTRLKEY_AND_OR_LR_ALTKEY
> etc. (about twenty of them i think?)
The reason for current bitmasks is to enable a detection what modifier =20=
keys are pressed. These are not events, since the events are actually =20=
Also when you want configurable keys, the modifier keymask can be just =20=
set separate. Would be even better to devise a small event structure =20
for it, holding all information. Such a struct is there already, but =20
not nicely integrated with the queues yet.
Names also can be simplified into ALTKEY|CTRLKEY etc...
Lastly; case switches work only with constants... user definable keys =20=
therefore have to be coded differently.
> perhaps start at 5000 above whatever the highest event value isis and =20=
> increment by 1000.
> Then, the key combination definitions are done like
> #define MAKE_PARENT (LR_CTRLKEY_AND_OR_LR_SHIFTKEY + PKEY)
> and the switch case would be
> case MAKE_PARENT: make_parent(); Handled =3D TRUE; break;
> I'm making changes and seperating out drawipo.c , the toets.c, space.c =
> and other files that have lots of hardcoded values. and mix key =20
> combo/event evaluation with function definitions.
> Tom M.
> MSN Toolbar provides one-click access to Hotmail from any Web page =96 =
> FREE download! =20
> Bf-committers mailing list
Ton Roosendaal Blender Foundation email@example.com =20