1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
165 |
|
|
166 |
public void |
public void |
167 |
registerKeys(JComponent c) { |
registerKeys(JComponent c) { |
168 |
KeyStroke k = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.CTRL_MASK); |
int modKey = CC.getViewConfig().getDefaultModKey(); |
169 |
|
|
170 |
|
KeyStroke k = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, modKey); |
171 |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "scrollLeft"); |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "scrollLeft"); |
172 |
c.getActionMap().put("scrollLeft", actionScrollLeft); |
c.getActionMap().put("scrollLeft", actionScrollLeft); |
173 |
|
|
174 |
k = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_MASK); |
k = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, modKey); |
175 |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "scrollRight"); |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "scrollRight"); |
176 |
c.getActionMap().put("scrollRight", actionScrollRight); |
c.getActionMap().put("scrollRight", actionScrollRight); |
177 |
|
|
178 |
k = KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK); |
k = KeyStroke.getKeyStroke(KeyEvent.VK_UP, modKey); |
179 |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "increaseKeyRange"); |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "increaseKeyRange"); |
180 |
c.getActionMap().put("increaseKeyRange", actionIncreaseKeyNumber); |
c.getActionMap().put("increaseKeyRange", actionIncreaseKeyNumber); |
181 |
|
|
182 |
k = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK); |
k = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, modKey); |
183 |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "decreaseKeyRange"); |
c.getInputMap(JComponent.WHEN_FOCUSED).put(k, "decreaseKeyRange"); |
184 |
c.getActionMap().put("decreaseKeyRange", actionDecreaseKeyNumber); |
c.getActionMap().put("decreaseKeyRange", actionDecreaseKeyNumber); |
185 |
|
|