2
0
Эх сурвалжийг харах

+ introduced PTCKEY_LESS (the 102th key on international keyboards, <> when
used with US keyboard layout)

Nikolay Nikolov 3 жил өмнө
parent
commit
f183b2952e

+ 4 - 0
packages/ptc/docs/CHANGES.txt

@@ -1,3 +1,7 @@
+next
+ - added PTCKEY_LESS, which represents the <> key (the 102th key on
+   international PC keyboards)
+
 0.99.16
  - added and implemented SetMousePos in unit ptcmouse
  - applied patch by Nicolas QSO <[email protected]> that fixes the handling of

+ 1 - 0
packages/ptc/examples/keyboard3.pp

@@ -146,6 +146,7 @@ begin
     PTCKEY_MINUS        : Result := 'PTCKEY_MINUS';
     PTCKEY_BACKQUOTE    : Result := 'PTCKEY_BACKQUOTE';
     PTCKEY_QUOTE        : Result := 'PTCKEY_QUOTE';
+    PTCKEY_LESS         : Result := 'PTCKEY_LESS';
     PTCKEY_COMMAND      : Result := 'PTCKEY_COMMAND';
     PTCKEY_FUNCTION     : Result := 'PTCKEY_FUNCTION';
     else

+ 1 - 0
packages/ptc/src/core/keyeventd.inc

@@ -192,6 +192,7 @@ const
   PTCKEY_MINUS        = $BD;
   PTCKEY_BACKQUOTE    = $C0;
   PTCKEY_QUOTE        = $DE;
+  PTCKEY_LESS         = $E2;
   PTCKEY_COMMAND      = $100;
   PTCKEY_F13          = $101;
   PTCKEY_F14          = $102;

+ 10 - 6
packages/ptc/src/x11/x11displayi.inc

@@ -566,12 +566,16 @@ begin
   end;
 
   key := nil;
-  case sym_modded shr 8 of
-    0: key := TPTCKeyEvent.Create(FNormalKeys[sym_modded and $FF], uni, modkeys, press);
-    $FF: key := TPTCKeyEvent.Create(FFunctionKeys[sym_modded and $FF], uni, modkeys, press);
-    else
-      key := TPTCKeyEvent.Create(PTCKEY_UNDEFINED, uni, modkeys, press);
-  end;
+  { handle the <> key by checking sym, instead of sym_modded }
+  if sym = XK_less then
+    key := TPTCKeyEvent.Create(PTCKEY_LESS, uni, modkeys, press)
+  else
+    case sym_modded shr 8 of
+      0: key := TPTCKeyEvent.Create(FNormalKeys[sym_modded and $FF], uni, modkeys, press);
+      $FF: key := TPTCKeyEvent.Create(FFunctionKeys[sym_modded and $FF], uni, modkeys, press);
+      else
+        key := TPTCKeyEvent.Create(PTCKEY_UNDEFINED, uni, modkeys, press);
+    end;
   if (not eaten_by_im) or (pmkDeadKey in modkeys) then
     FEventQueue.AddEvent(key);
 end;