[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52293] trunk/blender/source/blender/ windowmanager/intern/wm_playanim.c: playanim: make alphanumeric +/ - and numpad +/- work the same way.
Campbell Barton
ideasman42 at gmail.com
Sat Nov 17 07:32:43 CET 2012
Revision: 52293
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52293
Author: campbellbarton
Date: 2012-11-17 06:32:35 +0000 (Sat, 17 Nov 2012)
Log Message:
-----------
playanim: make alphanumeric +/- and numpad +/- work the same way.
better for users without a numpad.
- Ctrl +/-: Zooms
- +/-: Controls playback speed
Modified Paths:
--------------
trunk/blender/source/blender/windowmanager/intern/wm_playanim.c
Modified: trunk/blender/source/blender/windowmanager/intern/wm_playanim.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_playanim.c 2012-11-17 06:14:25 UTC (rev 52292)
+++ trunk/blender/source/blender/windowmanager/intern/wm_playanim.c 2012-11-17 06:32:35 UTC (rev 52293)
@@ -136,6 +136,7 @@
WS_QUAL_ALT = (WS_QUAL_LALT | WS_QUAL_RALT),
WS_QUAL_LCTRL = (1 << 4),
WS_QUAL_RCTRL = (1 << 5),
+ WS_QUAL_CTRL = (WS_QUAL_LCTRL | WS_QUAL_RCTRL),
WS_QUAL_LMOUSE = (1 << 16),
WS_QUAL_MMOUSE = (1 << 17),
WS_QUAL_RMOUSE = (1 << 18),
@@ -183,12 +184,12 @@
/* Alt */
GHOST_GetModifierKeyState(g_WS.ghost_system, GHOST_kModifierKeyLeftAlt, &val);
- if (val) g_WS.qual |= WS_QUAL_LCTRL;
- else g_WS.qual &= ~WS_QUAL_LCTRL;
+ if (val) g_WS.qual |= WS_QUAL_LALT;
+ else g_WS.qual &= ~WS_QUAL_LALT;
GHOST_GetModifierKeyState(g_WS.ghost_system, GHOST_kModifierKeyRightAlt, &val);
- if (val) g_WS.qual |= WS_QUAL_RCTRL;
- else g_WS.qual &= ~WS_QUAL_RCTRL;
+ if (val) g_WS.qual |= WS_QUAL_RALT;
+ else g_WS.qual &= ~WS_QUAL_RALT;
/* LMB */
GHOST_GetButtonState(g_WS.ghost_system, GHOST_kButtonMaskLeft, &val);
@@ -548,28 +549,6 @@
}
}
break;
- case GHOST_kKeyEqual:
- if (val) {
- if (g_WS.qual & WS_QUAL_SHIFT) {
- ps->pause++;
- printf("pause:%d\n", ps->pause);
- }
- else {
- swaptime /= 1.1;
- }
- }
- break;
- case GHOST_kKeyMinus:
- if (val) {
- if (g_WS.qual & WS_QUAL_SHIFT) {
- ps->pause--;
- printf("pause:%d\n", ps->pause);
- }
- else {
- swaptime *= 1.1;
- }
- }
- break;
case GHOST_kKeyNumpad0:
if (val) {
if (ps->once) {
@@ -597,14 +576,28 @@
}
}
break;
+ case GHOST_kKeyEqual:
case GHOST_kKeyNumpadPlus:
+ {
if (val == 0) break;
- playanim_window_zoom(ps, 1.0f);
+ if (g_WS.qual & WS_QUAL_CTRL) {
+ playanim_window_zoom(ps, 1.0f);
+ }
+ else {
+ swaptime /= 1.1;
+ }
break;
+ }
+ case GHOST_kKeyMinus:
case GHOST_kKeyNumpadMinus:
{
if (val == 0) break;
- playanim_window_zoom(ps, -1.0f);
+ if (g_WS.qual & WS_QUAL_CTRL) {
+ playanim_window_zoom(ps, -1.0f);
+ }
+ else {
+ swaptime *= 1.1;
+ }
break;
}
case GHOST_kKeyEsc:
@@ -1010,6 +1003,18 @@
if (hasevent) {
GHOST_DispatchEvents(g_WS.ghost_system);
}
+ if (ps.wait2) {
+ if (hasevent) {
+ if (ibuf) {
+ while (pupdate_time()) PIL_sleep_ms(1);
+ ptottime -= swaptime;
+ playanim_toscreen(ps.picture, ibuf, ps.fontid, ps.fstep);
+ }
+ }
+ }
+ if (!ps.go) {
+ break;
+ }
}
ps.wait2 = ps.sstep;
More information about the Bf-blender-cvs
mailing list