- try {
- // Retrieves the notenumber from the conversion array.
- int noteNumber = keyToNote[e.getKeyCode()];
- // If note is not already on and the key is mapped to a note, sends the NoteOn event.
- if (!isOn[noteNumber] && noteNumber > 0) Moosique.getActiveChannel().noteOn(noteNumber, 127);
- isOn[noteNumber] = true;
- } catch (ArrayIndexOutOfBoundsException x) {
- return;
+ if (!e.isControlDown()) {
+ try {
+ // Retrieves the notenumber from the conversion array.
+ int noteNumber = keyToNote[e.getKeyCode()];
+ // If note is not already on and the key is mapped to a note, sends the NoteOn event.
+ if (!isOn[noteNumber] && noteNumber > 0) {
+ if (recording) {
+ ShortMessage msg = new ShortMessage();
+ msg.setMessage(ShortMessage.NOTE_ON, title.getChannel(), noteNumber, 100);
+ Moosique.getSequencer().getReceiver().send(msg, -1);
+ } else {
+ Moosique.getActiveChannel().noteOn(noteNumber, 127);
+ }
+ }
+ isOn[noteNumber] = true;
+ } catch (Exception x) {
+ return;
+ }