The example script uses only the "Set Mouse Modifier..." command. They run very slowly, and they cannot respond in time when switching quickly between these three modes. Probably delayed by 2 seconds.
It can be painful to write notes.
This problem exists in Windows 10, I have tried other Windows 10 systems, they are all very slow.
Code:
--Select.lua
reaper.PreventUIRefresh(1)
HWND = reaper.MIDIEditor_GetActive()
reaper.MIDIEditor_OnCommand(HWND, 39707) -- Set default mouse modifier action for "MIDI piano roll left click" to "Deselect all notes"
reaper.MIDIEditor_OnCommand(HWND, 39487) -- Set default mouse modifier action for "MIDI piano roll left drag" to "Marquee select notes"
reaper.MIDIEditor_OnCommand(HWND, 39354) -- Set default mouse modifier action for "MIDI CC lane left drag" to "Edit selected CC events if any, otherwise draw/edit" (factory default)
reaper.MIDIEditor_OnCommand(HWND, 39402) -- Set default mouse modifier action for "MIDI CC event left click/drag" to "Draw/edit CC events ignoring selection"
reaper.MIDIEditor_OnCommand(HWND, 39673) -- Set default mouse modifier action for "MIDI note left click" to "Select note"
reaper.MIDIEditor_OnCommand(HWND, 39289) -- Set default mouse modifier action for "MIDI note left drag" to "Move note" (factory default)
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()
Code:
--Draw.lua
reaper.PreventUIRefresh(1)
HWND = reaper.MIDIEditor_GetActive()
reaper.MIDIEditor_OnCommand(HWND, 39708) -- Set default mouse modifier action for "MIDI piano roll left click" to "Insert note"
reaper.MIDIEditor_OnCommand(HWND, 39481) -- Set default mouse modifier action for "MIDI piano roll left drag" to "Insert note, drag to extend or change pitch" (factory default)
reaper.MIDIEditor_OnCommand(HWND, 39354) -- Set default mouse modifier action for "MIDI CC lane left drag" to "Edit selected CC events if any, otherwise draw/edit" (factory default)
reaper.MIDIEditor_OnCommand(HWND, 39673) -- Set default mouse modifier action for "MIDI note left click" to "Select note"
reaper.MIDIEditor_OnCommand(HWND, 39289) -- Set default mouse modifier action for "MIDI note left drag" to "Move note" (factory default)
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()