equal
deleted
inserted
replaced
27 |
27 |
28 package sun.awt.X11; |
28 package sun.awt.X11; |
29 import java.util.Hashtable; |
29 import java.util.Hashtable; |
30 import sun.misc.Unsafe; |
30 import sun.misc.Unsafe; |
31 |
31 |
32 import java.util.logging.Level; |
32 import sun.util.logging.PlatformLogger; |
33 import java.util.logging.Logger; |
|
34 |
33 |
35 public class XKeysym { |
34 public class XKeysym { |
36 |
35 |
37 public static void main( String args[] ) { |
36 public static void main( String args[] ) { |
38 System.out.println( "Cyrillc zhe:"+convertKeysym(0x06d6, 0)); |
37 System.out.println( "Cyrillc zhe:"+convertKeysym(0x06d6, 0)); |
68 // from XWindow.c altogether. |
67 // from XWindow.c altogether. |
69 // Another use for reverse lookup: query keyboard state, for some keys. |
68 // Another use for reverse lookup: query keyboard state, for some keys. |
70 static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>(); |
69 static Hashtable<Integer, Long> javaKeycode2KeysymHash = new Hashtable<Integer, Long>(); |
71 static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize()); |
70 static long keysym_lowercase = unsafe.allocateMemory(Native.getLongSize()); |
72 static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize()); |
71 static long keysym_uppercase = unsafe.allocateMemory(Native.getLongSize()); |
73 private static Logger keyEventLog = Logger.getLogger("sun.awt.X11.kye.XKeysym"); |
72 private static PlatformLogger keyEventLog = PlatformLogger.getLogger("sun.awt.X11.kye.XKeysym"); |
74 public static char convertKeysym( long ks, int state ) { |
73 public static char convertKeysym( long ks, int state ) { |
75 |
74 |
76 /* First check for Latin-1 characters (1:1 mapping) */ |
75 /* First check for Latin-1 characters (1:1 mapping) */ |
77 if ((ks >= 0x0020 && ks <= 0x007e) || |
76 if ((ks >= 0x0020 && ks <= 0x007e) || |
78 (ks >= 0x00a0 && ks <= 0x00ff)) { |
77 (ks >= 0x00a0 && ks <= 0x00ff)) { |