From: amwaterhouse Date: Thu, 12 Apr 2007 14:00:59 +0000 (+0000) Subject: Number pad keys can be used in cursor mode X-Git-Tag: Release_2_3~251 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1a6f14e0fe4826e8232ae7edd6767cd5d95fbbae;p=jalview.git Number pad keys can be used in cursor mode --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 7f2b497..4ee6e27 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -190,12 +190,16 @@ public class AlignFrame public void keyPressed(KeyEvent evt) { - if (viewport.cursorMode - && evt.getKeyCode() >= KeyEvent.VK_0 - && evt.getKeyCode() <= KeyEvent.VK_9) - { - alignPanel.seqPanel.numberPressed(evt.getKeyChar()); - } + if (viewport.cursorMode && + ( (evt.getKeyCode() >= KeyEvent.VK_0 && + evt.getKeyCode() <= KeyEvent.VK_9) + || + (evt.getKeyCode() >= KeyEvent.VK_NUMPAD0 && + evt.getKeyCode() <= KeyEvent.VK_NUMPAD9) + ) + && Character.isDigit(evt.getKeyChar())) + alignPanel.seqPanel.numberPressed(evt.getKeyChar()); + switch (evt.getKeyCode()) { diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 7db8f01..8ece83f 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -170,12 +170,16 @@ public class AlignFrame { public void keyPressed(KeyEvent evt) { - if (viewport.cursorMode - && evt.getKeyCode() >= KeyEvent.VK_0 - && evt.getKeyCode() <= KeyEvent.VK_9) - { + if (viewport.cursorMode && + ( (evt.getKeyCode() >= KeyEvent.VK_0 && + evt.getKeyCode() <= KeyEvent.VK_9) + || + (evt.getKeyCode() >= KeyEvent.VK_NUMPAD0 && + evt.getKeyCode() <= KeyEvent.VK_NUMPAD9) + ) + && Character.isDigit(evt.getKeyChar())) alignPanel.seqPanel.numberPressed(evt.getKeyChar()); - } + switch (evt.getKeyCode()) {