Bug fix #25042
authorTon Roosendaal <ton@blender.org>
Sun, 5 Dec 2010 12:14:02 +0000 (12:14 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 5 Dec 2010 12:14:02 +0000 (12:14 +0000)
Emulate numpad option: failed to use zero key to reset color picker.

source/blender/editors/interface/interface_handlers.c

index 8724b7fad28c0c8ae16460eaea0108923aec1416..35aa351dc20d3fb827ab9b54f7ada213bec858c3 100644 (file)
@@ -3062,7 +3062,8 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
                        
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (event->type == ZEROKEY && event->val == KM_PRESS) {
+               /* XXX hardcoded keymap check.... */
+               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
                        if (but->a1==UI_GRAD_V_ALT){
                                int len;
                                
@@ -3183,7 +3184,8 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (event->type == ZEROKEY && event->val == KM_PRESS) {
+               /* XXX hardcoded keymap check.... */
+               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
                        int len;
                        
                        /* reset only saturation */
@@ -3628,7 +3630,8 @@ static int ui_do_but_HISTOGRAM(bContext *C, uiBlock *block, uiBut *but, uiHandle
                        
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (event->type == ZEROKEY && event->val == KM_PRESS) {
+               /* XXX hardcoded keymap check.... */
+               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
                        Histogram *hist = (Histogram *)but->poin;
                        hist->ymax = 1.f;
                        
@@ -3710,7 +3713,8 @@ static int ui_do_but_WAVEFORM(bContext *C, uiBlock *block, uiBut *but, uiHandleB
 
                        return WM_UI_HANDLER_BREAK;
                }
-               else if (event->type == ZEROKEY && event->val == KM_PRESS) {
+               /* XXX hardcoded keymap check.... */
+               else if (ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
                        Scopes *scopes = (Scopes *)but->poin;
                        scopes->wavefrm_yfac = 1.f;
 
@@ -4336,7 +4340,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
                        return WM_UI_HANDLER_BREAK;
                }
                /* reset to default */
-               else if(ELEM(event->type, ZEROKEY,PAD0) && event->val == KM_PRESS) {
+               /* XXX hardcoded keymap check.... */
+               else if(ELEM(event->type, ZEROKEY, PAD0) && event->val == KM_PRESS) {
                        if (!(ELEM3(but->type, HSVCIRCLE, HSVCUBE, HISTOGRAM)))
                                ui_set_but_default(C, but);
                }