Example #1
1
 /* returns true if deletion is allowed */
 private boolean isAllowedDeletion() {
   if ((org.lwjgl.input.Keyboard.getEventKey() == org.lwjgl.input.Keyboard.KEY_BACK)
       && (text.length() > 1)
       && (cursorLocation > 0)) return true;
   else return false;
 }
Example #2
1
 /* returns true if the users right arrow navigation is allowed */
 private boolean isAllowedRightArrowNavigation() {
   if (org.lwjgl.input.Keyboard.getEventKey() == org.lwjgl.input.Keyboard.KEY_RIGHT
       && cursorLocation < text.length() - 1) return true;
   else return false;
 }
Example #3
0
 /* returns true if the key press is the return key */
 private boolean isAllowedNewLine() {
   if (org.lwjgl.input.Keyboard.getEventKey() == org.lwjgl.input.Keyboard.KEY_RETURN) return true;
   else return false;
 }
Example #4
0
 /* returns true if the users left arrow navigation is allowed */
 private boolean isAllowedLeftArrowNavigation() {
   if (org.lwjgl.input.Keyboard.getEventKey() == org.lwjgl.input.Keyboard.KEY_LEFT
       && cursorLocation > 0) return true;
   else return false;
 }
Example #5
0
 /* returns true if pressed button is allowed for "writing" */
 private boolean isAllowedCharacters() {
   if ((org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_BACK)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_LEFT)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_RIGHT)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_UP)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_DOWN)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_RSHIFT)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_LSHIFT)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_RCONTROL)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_LCONTROL)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_RMENU)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_RMETA)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_LMETA)
       && (org.lwjgl.input.Keyboard.getEventKey() != org.lwjgl.input.Keyboard.KEY_LMENU))
     return true;
   else return false;
 }