MCPcopy Create free account
hub / github.com/TheWaveWarden/odin2 / keyStateChanged

Method keyStateChanged

Source/PluginEditor.cpp:1181–1315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179}
1180
1181bool OdinEditor::keyStateChanged(bool isKeyDown, Component *originatingComponent) {
1182
1183 if (m_is_standalone_plugin) {
1184
1185 if (KeyPress::isKeyCurrentlyDown(65) != m_A_down) {
1186 m_A_down = KeyPress::isKeyCurrentlyDown(65);
1187 if (m_A_down) {
1188 processor.handleMidiNoteOn(48 + m_octave_shift * 12, 100);
1189 } else {
1190 processor.handleMidiNoteOff(48 + m_octave_shift * 12);
1191 }
1192 }
1193 if (KeyPress::isKeyCurrentlyDown(87) != m_W_down) {
1194 m_W_down = KeyPress::isKeyCurrentlyDown(87);
1195 if (m_W_down) {
1196 processor.handleMidiNoteOn(49 + m_octave_shift * 12, 100);
1197 } else {
1198 processor.handleMidiNoteOff(49 + m_octave_shift * 12);
1199 }
1200 }
1201 if (KeyPress::isKeyCurrentlyDown(83) != m_S_down) {
1202 m_S_down = KeyPress::isKeyCurrentlyDown(83);
1203 if (m_S_down) {
1204 processor.handleMidiNoteOn(50 + m_octave_shift * 12, 100);
1205 } else {
1206 processor.handleMidiNoteOff(50 + m_octave_shift * 12);
1207 }
1208 }
1209 if (KeyPress::isKeyCurrentlyDown(69) != m_E_down) {
1210 m_E_down = KeyPress::isKeyCurrentlyDown(69);
1211 if (m_E_down) {
1212 processor.handleMidiNoteOn(51 + m_octave_shift * 12, 100);
1213 } else {
1214 processor.handleMidiNoteOff(51 + m_octave_shift * 12);
1215 }
1216 }
1217 if (KeyPress::isKeyCurrentlyDown(68) != m_D_down) {
1218 m_D_down = KeyPress::isKeyCurrentlyDown(68);
1219 if (m_D_down) {
1220 processor.handleMidiNoteOn(52 + m_octave_shift * 12, 100);
1221 } else {
1222 processor.handleMidiNoteOff(52 + m_octave_shift * 12);
1223 }
1224 }
1225 if (KeyPress::isKeyCurrentlyDown(70) != m_F_down) {
1226 m_F_down = KeyPress::isKeyCurrentlyDown(70);
1227 if (m_F_down) {
1228 processor.handleMidiNoteOn(53 + m_octave_shift * 12, 100);
1229 } else {
1230 processor.handleMidiNoteOff(53 + m_octave_shift * 12);
1231 }
1232 }
1233 if (KeyPress::isKeyCurrentlyDown(84) != m_T_down) {
1234 m_T_down = KeyPress::isKeyCurrentlyDown(84);
1235 if (m_T_down) {
1236 processor.handleMidiNoteOn(54 + m_octave_shift * 12, 100);
1237 } else {
1238 processor.handleMidiNoteOff(54 + m_octave_shift * 12);

Callers

nothing calls this directly

Calls 2

handleMidiNoteOnMethod · 0.80
handleMidiNoteOffMethod · 0.80

Tested by

no test coverage detected