]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/KeyEvents.py
'[1219035] cleanup: miscellaneous' and minor source cleaning.
[wxWidgets.git] / wxPython / demo / KeyEvents.py
index 1ca318a327aef5df669064090f0cff8b43b5c1d3..71acdf2294801ff9d8b2be85fd775b07d1e55f84 100644 (file)
@@ -122,7 +122,7 @@ class KeySink(wx.Window):
 
         self.SetBackgroundColour(wx.BLUE)
         self.haveFocus = False
 
         self.SetBackgroundColour(wx.BLUE)
         self.haveFocus = False
-        self.callSkip = False
+        self.callSkip = True
         self.logKeyDn = True
         self.logKeyUp = True
         self.logChar = True
         self.logKeyDn = True
         self.logKeyUp = True
         self.logChar = True
@@ -226,15 +226,19 @@ class KeyLog(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
         keycode = evt.GetKeyCode()
         keyname = keyMap.get(keycode, None)
         if keyname is None:
         keycode = evt.GetKeyCode()
         keyname = keyMap.get(keycode, None)
         if keyname is None:
-            if keycode < 256:
+            if "unicode" in wx.PlatformInfo:
+                keycode = evt.GetUnicodeKey()
+                if keycode <= 127:
+                    keycode = evt.GetKeyCode()
+                keyname = "\"" + unichr(evt.GetUnicodeKey()) + "\""
+                
+            elif keycode < 256:
                 if keycode == 0:
                     keyname = "NUL"
                 elif keycode < 27:
                     keyname = "Ctrl-%s" % chr(ord('A') + keycode-1)
                 else:
                     keyname = "\"%s\"" % chr(keycode)
                 if keycode == 0:
                     keyname = "NUL"
                 elif keycode < 27:
                     keyname = "Ctrl-%s" % chr(ord('A') + keycode-1)
                 else:
                     keyname = "\"%s\"" % chr(keycode)
-            elif "unicode" in wx.PlatformInfo:
-                keyname = "\"" + unichr(keycode) + "\""
             else:
                 keyname = "unknown (%s)" % keycode
 
             else:
                 keyname = "unknown (%s)" % keycode
 
@@ -314,6 +318,7 @@ class TestPanel(wx.Panel):
 
         cb1 = wx.CheckBox(self, -1, "Call evt.Skip in Key* events")
         self.Bind(wx.EVT_CHECKBOX, self.OnSkipCB, cb1)
 
         cb1 = wx.CheckBox(self, -1, "Call evt.Skip in Key* events")
         self.Bind(wx.EVT_CHECKBOX, self.OnSkipCB, cb1)
+        cb1.SetValue(True)
 
         cb2 = wx.CheckBox(self, -1, "KEY_UP")
         self.Bind(wx.EVT_CHECKBOX, self.OnKeyUpCB, cb2)
 
         cb2 = wx.CheckBox(self, -1, "KEY_UP")
         self.Bind(wx.EVT_CHECKBOX, self.OnKeyUpCB, cb2)