Report #1457
authorTon Roosendaal <ton@blender.org>
Fri, 23 Jul 2004 21:07:32 +0000 (21:07 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 23 Jul 2004 21:07:32 +0000 (21:07 +0000)
The laptop option "no numpad" did this in the main queue, for all windows.
This caused problems, like for text editing in 3d window.
Now it only does it in 3d window, and not with editmode for Text object.

source/blender/src/editscreen.c
source/blender/src/space.c

index f53dbb2d5f4850d90114626e3d3cc57591f5b0c6..9cf11275f73a43463565e2a41fef664197bb1f69 100644 (file)
@@ -1725,30 +1725,11 @@ short get_mbut(void)
        return window_get_mbut(mainwin);
 }
 
-static unsigned short convert_for_nonumpad(unsigned short event)
-{
-       if (event>=ZEROKEY && event<=NINEKEY) {
-               return event - ZEROKEY + PAD0;
-       } else if (event==MINUSKEY) {
-               return PADMINUS;
-       } else if (event==EQUALKEY) {
-               return PADPLUSKEY;
-       } else if (event==BACKSLASHKEY) {
-               return PADSLASHKEY;
-       } else {
-               return event;
-       }
-}
-
 void add_to_mainqueue(Window *win, void *user_data, short evt, short val, char ascii)
 {
 
        statechanged= 1;
 
-       if (U.flag & USER_NONUMPAD) {
-               evt= convert_for_nonumpad(evt);
-       }
-
        /*  accept the extended ascii set (ton) */
        if( !val || ascii<32 ) {
                ascii= '\0';
index 88ce12fa0cad15afb6e650d338021b463039f17d..31111deecaefc6eb580202fa78802854f74aa171 100644 (file)
@@ -603,6 +603,21 @@ void select_group(short nr)
        allqueue(REDRAWIPO, 0);
 }
 
+static unsigned short convert_for_nonumpad(unsigned short event)
+{
+       if (event>=ZEROKEY && event<=NINEKEY) {
+               return event - ZEROKEY + PAD0;
+       } else if (event==MINUSKEY) {
+               return PADMINUS;
+       } else if (event==EQUALKEY) {
+               return PADPLUSKEY;
+       } else if (event==BACKSLASHKEY) {
+               return PADSLASHKEY;
+       } else {
+               return event;
+       }
+}
+
 void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
        unsigned short event= evt->event;
@@ -751,6 +766,11 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        }
                }
                else {
+
+                       if (U.flag & USER_NONUMPAD) {
+                               event= convert_for_nonumpad(event);
+                       }
+
                        switch(event) {
                        
                        case BACKBUFDRAW: