Last active
June 1, 2021 07:13
-
-
Save X-Raym/af122adbc995f2a028749daf52f2ce6c to your computer and use it in GitHub Desktop.
DaVinci Resolve AutoHotKey KeyBoard Shorcuts and MIDI Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GetActiveWindowProcessName() { | |
WinGet, Active_ID, ID, A | |
WinGet, Active_Process, ProcessName, ahk_id %Active_ID% | |
return Active_Process | |
} | |
`;:: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
send {WheelDown 1} | |
return | |
} else { | |
send {Text}; | |
return | |
} | |
::: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
send {WheelUp 1} | |
return | |
} else { | |
send {Text}: | |
return | |
} | |
,:: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
Send {LButton Down} ;Press left mouse button | |
KeyWait `, ;wait for release of "," | |
Send {LButton Up} ;release Left Mouse button | |
Return ;End Hotkey | |
} else { | |
send {Text}, | |
return | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance force | |
#include Midi.ahk ;https://github.com/hetima/AutoHotkey-Midi | |
GetActiveWindowProcessName() { | |
WinGet, Active_ID, ID, A | |
WinGet, Active_Process, ProcessName, ahk_id %Active_ID% | |
return Active_Process | |
} | |
Msg(str) { | |
ToolTip, %str% | |
SetTimer, RemoveToolTip, -1000 | |
return | |
} | |
midi := new Midi( "Maschine Mikro MK3", "Maschine Mikro MK3" ) | |
precizion_mod := 127 ;CC8 | |
RemoveToolTip: | |
ToolTip | |
return | |
SetDefaultMouseSpeed, 1 | |
Return | |
MidiNoteOnC1: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
MouseMove, 75, 950 | |
} | |
Return | |
MidiNoteOnC#1: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
MouseMove, 275, 950 | |
} | |
Return | |
MidiNoteOnD1: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
MouseMove, 475, 950 | |
} | |
Return | |
MidiNoteOnD#1: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
MouseMove, 675, 950 | |
} | |
Return | |
MidiNoteOnE1: | |
note := midi.MidiIn() | |
stat := note.status | |
if (stat == "NoteOn" and GetActiveWindowProcessName() = "Resolve.exe") { | |
;MouseClick, left, 313, 761 | |
Send !z | |
} | |
Return | |
MidiNoteOnF1: | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
;MouseClick, left, 351, 761 | |
} | |
Return | |
MidiControlChange7: | |
cc := midi.MidiIn() | |
ccValue := cc.value | |
precizion := 5 | |
if ( precizion_mod = 127 ) { | |
precizion = 10 | |
} else { | |
precizion = 5 | |
} | |
if (GetActiveWindowProcessName() = "Resolve.exe") { | |
MouseGetPos, xpos, ypos | |
if ( ccValue == 1) { | |
MouseClickDrag, Left, 0, 0, precizion, 0, 0, R | |
MouseMove, xpos, ypos, 2 | |
;send {WheelUp 1} | |
} else { | |
MouseClickDrag, Left, 0, 0, -precizion, 0, 0, R | |
MouseMove, xpos, ypos, 2 | |
;send {WheelDown 1} | |
} | |
} | |
Return | |
MidiControlChange8: | |
cc := midi.MidiIn() | |
ccValue := cc.value | |
precizion_mod := ccValue | |
Msg(precizion_mod) | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@anirbanbose142
This is done by some MIDI notes on the second file as I use it with a MIDI controller. You may need to mod it to put regular keyboard keys if you dont have access to a MIDI controller.