Changeset 8722


Ignore:
Timestamp:
03/06/05 16:26:15 (16 years ago)
Author:
piso
Message:

checkKeyboardQuit()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/Editor.java

    r8713 r8722  
    33 *
    44 * Copyright (C) 1998-2005 Peter Graves
    5  * $Id: Editor.java,v 1.143 2005-03-05 17:41:19 piso Exp $
     5 * $Id: Editor.java,v 1.144 2005-03-06 16:26:15 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    24382438    }
    24392439
     2440    // FIXME Removed hard-coded Control G!
     2441    public static boolean checkKeyboardQuit(Object object)
     2442    {
     2443        if (object instanceof JEvent) {
     2444            JEvent e = (JEvent) object;
     2445            if (e.getID() == JEvent.KEY_PRESSED) {
     2446                if (e.getKeyCode() == 0x47 && e.getModifiers() == 2)
     2447                    return true;
     2448            }
     2449            return false;
     2450        }
     2451        if (object instanceof KeyEvent) {
     2452            KeyEvent e = (KeyEvent) object;
     2453            if (e.getID() == KeyEvent.KEY_PRESSED) {
     2454                if (e.getKeyCode() == 0x47 && e.getModifiers() == 2)
     2455                    return true;
     2456            }
     2457            return false;
     2458        }
     2459        return false;
     2460    }
     2461
    24402462    private KeyMap requestedKeyMap;
    24412463
     
    24532475        }
    24542476        if (requestedKeyMap != null) {
    2455             if (keyChar == 7 && keyCode == 0x47 && modifiers == 2) {
    2456                 // Control G
     2477            if (checkKeyboardQuit(event)) {
    24572478                requestedKeyMap = null;
    24582479                currentEventSequence = null;
Note: See TracChangeset for help on using the changeset viewer.