Example #1
0
 /*     */ protected synchronized boolean getNextDeviceEvent(Event event) throws IOException {
   /*  86 */ if (!org.lwjgl.input.Keyboard.isCreated()) /*  87 */ return false;
   /*  88 */ if (!org.lwjgl.input.Keyboard.next()) /*  89 */ return false;
   /*  90 */ int lwjgl_key = org.lwjgl.input.Keyboard.getEventKey();
   /*  91 */ if (lwjgl_key == 0) /*  92 */ return false;
   /*  93 */ Component.Identifier.Key key_id = KeyMap.map(lwjgl_key);
   /*  94 */ if (key_id == null) /*  95 */ return false;
   /*  96 */ Component key = getComponent(key_id);
   /*  97 */ if (key == null) /*  98 */ return false;
   /*  99 */ float value = org.lwjgl.input.Keyboard.getEventKeyState() ? 1.0F : 0.0F;
   /* 100 */ event.set(key, value, org.lwjgl.input.Keyboard.getEventNanoseconds());
   /* 101 */ return true;
   /*     */ }
Example #2
0
 /*     */ private static Component[] createComponents() {
   /*  57 */ List components = new ArrayList();
   /*  58 */ Field[] vkey_fields = org.lwjgl.input.Keyboard.class.getFields();
   /*  59 */ for (Field vkey_field : vkey_fields) {
     /*     */ try {
       /*  61 */ if ((Modifier.isStatic(vkey_field.getModifiers()))
           && (vkey_field.getType() == Integer.TYPE)
           && (vkey_field.getName().startsWith("KEY_")))
       /*     */ {
         /*  63 */ int vkey_code = vkey_field.getInt(null);
         /*  64 */ Component.Identifier.Key key_id = KeyMap.map(vkey_code);
         /*  65 */ if (key_id != Component.Identifier.Key.UNKNOWN)
           /*  66 */ components.add(new Key(key_id, vkey_code));
         /*     */ }
       /*     */ } catch (IllegalAccessException e) {
       /*  69 */ throw new RuntimeException(e);
       /*     */ }
     /*     */ }
   /*  72 */ return (Component[]) components.toArray(new Component[components.size()]);
   /*     */ }