diff options
author | Matt Ebb <matt@mke3.net> | 2004-07-16 05:34:19 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2004-07-16 05:34:19 +0400 |
commit | 688a6de8789989522d1faf61349fc864b962137e (patch) | |
tree | 79f005679d1ab69037c520e5ef7cd9973e660be4 /source/blender/src/editaction.c | |
parent | e926d392a8dbfc06bbd1670ce11a750ce15a1170 (diff) |
* User preference to select with the left mouse button
instead of right.
This basically swaps left and right, in most window spaces
so you can choose between:
LMB: Cursor/time slider/paint - RMB: Select
or LMB: Select - RMB: Cursor/time slider/paint
Aimed at:
1. Newbies
2. 1 button mouse mac users
3. People like me who are sick of having to constantly keep putting their brains into different modes when
switching between other apps and Blender :)
Yes, the User Preferences window is a bit of a nightmare
now, a layout cleanup will be forthcoming soon...
Diffstat (limited to 'source/blender/src/editaction.c')
-rw-r--r-- | source/blender/src/editaction.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 523fc5bf91a..f74ec089b93 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -2221,6 +2221,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) short mval[2]; unsigned short event= evt->event; short val= evt->val; + short mousebut = L_MOUSE; if(curarea->win==0) return; @@ -2233,6 +2234,17 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; + /* swap mouse buttons based on user preference */ + if (U.flag & USER_LMOUSESELECT) { + if (evt->event == LEFTMOUSE) { + event = RIGHTMOUSE; + mousebut = L_MOUSE; + } else if (evt->event == RIGHTMOUSE) { + event = LEFTMOUSE; + mousebut = R_MOUSE; + } + } + getmouseco_areawin(mval); key = get_action_mesh_key(); @@ -2241,6 +2253,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) case UI_BUT_EVENT: do_actionbuts(val); // window itself break; + case HOMEKEY: do_action_buttons(B_ACTHOME); // header break; @@ -2423,7 +2436,9 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) delete_actionchannel_keys (); } break; - + /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, + * based on user preference USER_LMOUSESELECT + */ case LEFTMOUSE: if (mval[0]>ACTWIDTH){ do { @@ -2442,12 +2457,11 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) force_draw_plus(SPACE_BUTS); } - } while(get_mbut()&L_MOUSE); - break; + } while(get_mbut() & mousebut); } - /* no break here, we allow leftmouse click too */ + break; case RIGHTMOUSE: - /* Right clicking in the channel area selects the + /* Clicking in the channel area selects the * channel or constraint channel */ if (mval[0]<NAMEWIDTH) { @@ -2460,8 +2474,8 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) else numbuts_action(); } else if (mval[0]>ACTWIDTH) { - - /* Right clicking in the vertical scrollbar selects + + /* Clicking in the vertical scrollbar selects * all of the keys for that channel at that height */ if (IN_2D_VERT_SCROLL(mval)) { @@ -2472,8 +2486,8 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) select_all_keys_channels(act, mval, NULL, SELECT_REPLACE); } - - /* Right clicking in the horizontal scrollbar selects + + /* Clicking in the horizontal scrollbar selects * all of the keys within 0.5 of the nearest integer * frame */ @@ -2505,7 +2519,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } } break; - case MIDDLEMOUSE: case WHEELUPMOUSE: case WHEELDOWNMOUSE: |