Patch to EventSource.st

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch to EventSource.st

Tony Garnock-Jones-2

--
  [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
    [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
  []  [] http://www.lshift.net/ | Email: [hidden email]

From d6f5d6ac72221aaf944d315749abd2ed593ab3a6 Mon Sep 17 00:00:00 2001
From: Tony Garnock-Jones <[hidden email]>
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


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Patch to EventSource.st

Paolo Bonzini-2
committed as 1f0d80f37081c9ab6fb56d34cfeb8a606dfe84a2, thanks

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk