help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Patch to EventSource.st


From: Tony Garnock-Jones
Subject: [Help-smalltalk] Patch to EventSource.st
Date: Tue, 01 Jul 2008 09:58:13 +0100
User-agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509)


--
 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: address@hidden
>From d6f5d6ac72221aaf944d315749abd2ed593ab3a6 Mon Sep 17 00:00:00 2001
From: Tony Garnock-Jones <address@hidden>
Date: Tue, 1 Jul 2008 09:57:25 +0100
Subject: [PATCH] SDL's keysyms are chosen to map to ASCII when possible. Some 
codes are
 greater than 127, though; those shouldn't be converted to Character
 instances. Instead, they should be compared to the results of methods
 like "SdlKeySym sdlkLshift".

---
 packages/sdl/libsdl/EventSource.st |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/packages/sdl/libsdl/EventSource.st 
b/packages/sdl/libsdl/EventSource.st
index 572ec25..1e9a055 100644
--- a/packages/sdl/libsdl/EventSource.st
+++ b/packages/sdl/libsdl/EventSource.st
@@ -218,12 +218,20 @@ SdlKeyBoardEvent extend [
        ^ r
     ]
 
+    keySym [
+       | s |
+       s := self sym value.
+       ^ (s > 127)
+           ifTrue: [s]
+           ifFalse: [Character value: s]
+    ]
+
     dispatchTo: handler [
        <category: 'dispatch'>
        handler handleKey: self which value asInteger
                state: self state value asInteger ~= 0
                scanCode: self scanCode value asInteger
-               sym: (Character value: self sym value)
+               sym: self keySym
                mod: self keyboardModifiers
                unicode: (Character codePoint: self unicode value)
     ]
-- 
1.5.3.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]