changeset 724:41080d22edc8

Couple more fixes to keyhandling... committed before I finished what I was doing... Problem of views not having focus and ignoring the keystrokes remains...
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 14 Mar 2011 02:08:36 +0000
parents 37c8d2b4cec5
children 4e09c92363df
files dw.h mac/dw.m
diffstat 2 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Mon Mar 14 01:57:33 2011 +0000
+++ b/dw.h	Mon Mar 14 02:08:36 2011 +0000
@@ -429,7 +429,7 @@
 #define VK_NUMPAD9               92
 #define VK_MULTIPLY              67
 #define VK_ADD                   69
-#define VK_SEPARATOR             42
+#define VK_SEPARATOR             0xFF15 /* TODO */
 #define VK_SUBTRACT              78
 #define VK_DECIMAL               65
 #define VK_DIVIDE                75
@@ -457,7 +457,7 @@
 #define VK_F22                   0xF719 /* NSF22FunctionKey */
 #define VK_F23                   0xF71A /* NSF23FunctionKey */
 #define VK_F24                   0xF71B /* NSF24FunctionKey */
-#define VK_NUMLOCK               70
+#define VK_NUMLOCK               0xFF16 /* TODO */
 #define VK_SCROLL                0xF72F /* NSScrollLockFunctionKey */
 #define VK_LSHIFT                56
 #define VK_RSHIFT                60
--- a/mac/dw.m	Mon Mar 14 01:57:33 2011 +0000
+++ b/mac/dw.m	Mon Mar 14 02:08:36 2011 +0000
@@ -183,15 +183,11 @@
                 int (*keypressfunc)(HWND, char, int, int, void *) = handler->signalfunction;
                 NSString *nchar = [event charactersIgnoringModifiers];
                 int special = (int)[event modifierFlags];
+                unichar vk = [nchar characterAtIndex:0];
                 char ch;
-                    
-                /* Reject dead keys */
-                if([nchar length] == 0)
-                {
-                    return 0;
-                }
+                
                 /* Handle a valid key */
-                else if([nchar length] == 1)
+                if([nchar length] == 1)
                 {
                     const char *tmp = [nchar UTF8String];
                     if(tmp)
@@ -200,7 +196,7 @@
                     }
                 }
                     
-                return keypressfunc(handler->window, ch, 0, special, handler->data);
+                return keypressfunc(handler->window, ch, (int)vk, special, handler->data);
             }
             /* Button press and release event */
 			case 3: