Online Sequencer Make music online
  • Sequences
  • Members
  • Import MIDI
  • Forum

Existing user? Sign In Create account
Login at Online Sequencer Forums

Online Sequencer Forums › Online Sequencer › Suggestions › Completed Suggestions
« Previous 1 2 3

Hold CTRL for Multi-select

Thread tools
Hold CTRL for Multi-select
NothingHere Offline
Member
1 Posts:
 
#1
06-30-2016, 02:31 AM (This post was last modified: 06-30-2016, 02:45 AM by NothingHere. Edit Reason: Remove console.log line as it's unnecessary )
A really basic yet missing feature is the ability to hold CTRL (or Command for Macs) to select multiple notes with ease. 

Below is a simple yet working implementation:

Code:
// Tracks control key state
var ctrlDown = false;

// Override existing onNoteClick function
function onNoteClick(event) {
   var element = document.elementFromPoint(event.clientX, event.clientY);
   if (element != undefined && element.noteData != undefined && !instrumentLock[element.noteData.instrument]) {
       var note = element.noteData;
       if (note.selected == false) {

            // If control is down, don't clear the selection
           if(!ctrlDown)
               clearSelection();
           select(note);
       }
       dragSelection();
       playNote(note.instrument, note.type, note.length);
       window.top.confirmExit = true;
       return clickedNote = true;
   } else {
        // Don't clear the selection in-case the user accidentally misses the note
       if(!ctrlDown)
           clearSelection();
       return clickedNote = false;
   }
}

// Event listeners for the control key
window.addEventListener("keydown", function(event) {
   if (event.keyCode == 17) {
       ctrlDown = true;
   }
   
}, false);

window.addEventListener("keyup", function(event) {
   if (event.keyCode == 17) {
       ctrlDown = false;
   }
}, false);


Reply

Messages In This Thread
Hold CTRL for Multi-select - by NothingHere - 06-30-2016, 02:31 AM



Users browsing this thread:   1 Guest(s)


  •  Return to Top
  •  Contact Us
  •   Home
  •  Lite mode
© Rush Crafted with ❤ by iAndrew
Powered By MyBB, © 2002-2022 MyBB Group.
Linear Mode
Threaded Mode
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend