Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
J0CC-Famitracker patch to change hardcoded qwerty key notes to dvorak
diff --git a/Source/FamiTrackerView.cpp b/Source/FamiTrackerView.cpp
index f35c7ab..dac6fd4 100644
--- a/Source/FamiTrackerView.cpp
+++ b/Source/FamiTrackerView.cpp
@@ -3358,46 +3358,46 @@ int CFamiTrackerView::TranslateKeyDefault(Keycode Key) const
// Convert key to a note
switch (Key) {
- case 50: KeyNote = NOTE_Cs; KeyOctave += 1; break; // 2 // // //
- case 51: KeyNote = NOTE_Ds; KeyOctave += 1; break; // 3
- case 53: KeyNote = NOTE_Fs; KeyOctave += 1; break; // 5
- case 54: KeyNote = NOTE_Gs; KeyOctave += 1; break; // 6
- case 55: KeyNote = NOTE_As; KeyOctave += 1; break; // 7
- case 57: KeyNote = NOTE_Cs; KeyOctave += 2; break; // 9
- case 48: KeyNote = NOTE_Ds; KeyOctave += 2; break; // 0
- case 187: KeyNote = NOTE_Fs; KeyOctave += 2; break; // =+
-
- case 81: KeyNote = NOTE_C; KeyOctave += 1; break; // Q
- case 87: KeyNote = NOTE_D; KeyOctave += 1; break; // W
- case 69: KeyNote = NOTE_E; KeyOctave += 1; break; // E
- case 82: KeyNote = NOTE_F; KeyOctave += 1; break; // R
- case 84: KeyNote = NOTE_G; KeyOctave += 1; break; // T
- case 89: KeyNote = NOTE_A; KeyOctave += 1; break; // Y
- case 85: KeyNote = NOTE_B; KeyOctave += 1; break; // U
- case 73: KeyNote = NOTE_C; KeyOctave += 2; break; // I
- case 79: KeyNote = NOTE_D; KeyOctave += 2; break; // O
- case 80: KeyNote = NOTE_E; KeyOctave += 2; break; // P
- case 219: KeyNote = NOTE_F; KeyOctave += 2; break; // [{ // // //
- case 221: KeyNote = NOTE_G; KeyOctave += 2; break; // ]} // // //
-
- case 83: KeyNote = NOTE_Cs; break; // S
- case 68: KeyNote = NOTE_Ds; break; // D
- case 71: KeyNote = NOTE_Fs; break; // G
- case 72: KeyNote = NOTE_Gs; break; // H
- case 74: KeyNote = NOTE_As; break; // J
- case 76: KeyNote = NOTE_Cs; KeyOctave += 1; break; // L
- case 186: KeyNote = NOTE_Ds; KeyOctave += 1; break; // ;: // // //
-
- case 90: KeyNote = NOTE_C; break; // Z
- case 88: KeyNote = NOTE_D; break; // X
- case 67: KeyNote = NOTE_E; break; // C
- case 86: KeyNote = NOTE_F; break; // V
- case 66: KeyNote = NOTE_G; break; // B
- case 78: KeyNote = NOTE_A; break; // N
- case 77: KeyNote = NOTE_B; break; // M
- case 188: KeyNote = NOTE_C; KeyOctave += 1; break; // ,<
- case 190: KeyNote = NOTE_D; KeyOctave += 1; break; // .>
- case 191: KeyNote = NOTE_E; KeyOctave += 1; break; // /? // // //
+ case 50: KeyNote = NOTE_Cs; KeyOctave += 1; break; // 2 // // //
+ case 51: KeyNote = NOTE_Ds; KeyOctave += 1; break; // 3
+ case 53: KeyNote = NOTE_Fs; KeyOctave += 1; break; // 5
+ case 54: KeyNote = NOTE_Gs; KeyOctave += 1; break; // 6
+ case 55: KeyNote = NOTE_As; KeyOctave += 1; break; // 7
+ case 57: KeyNote = NOTE_Cs; KeyOctave += 2; break; // 9
+ case 48: KeyNote = NOTE_Ds; KeyOctave += 2; break; // 0
+ case 0xDD: KeyNote = NOTE_Fs; KeyOctave += 2; break; // ]
+
+ case 0xDE: KeyNote = NOTE_C; KeyOctave += 1; break; // '
+ case 0xBC: KeyNote = NOTE_D; KeyOctave += 1; break; // ,
+ case 0xBE: KeyNote = NOTE_E; KeyOctave += 1; break; // .
+ case 0x50: KeyNote = NOTE_F; KeyOctave += 1; break; // p
+ case 0x59: KeyNote = NOTE_G; KeyOctave += 1; break; // y
+ case 0x46: KeyNote = NOTE_A; KeyOctave += 1; break; // f
+ case 0x47: KeyNote = NOTE_B; KeyOctave += 1; break; // g
+ case 0x43: KeyNote = NOTE_C; KeyOctave += 2; break; // c
+ case 0x52: KeyNote = NOTE_D; KeyOctave += 2; break; // r
+ case 0x4C: KeyNote = NOTE_E; KeyOctave += 2; break; // l
+ case 0xBF: KeyNote = NOTE_F; KeyOctave += 2; break; // / // // //
+ case 0xBB: KeyNote = NOTE_G; KeyOctave += 2; break; // = // // //
+
+ case 0x4F: KeyNote = NOTE_Cs; break; // o
+ case 0x45: KeyNote = NOTE_Ds; break; // e
+ case 0x49: KeyNote = NOTE_Fs; break; // i
+ case 0x44: KeyNote = NOTE_Gs; break; // d
+ case 0x48: KeyNote = NOTE_As; break; // h
+ case 0x4E: KeyNote = NOTE_Cs; KeyOctave += 1; break; // n
+ case 0x53: KeyNote = NOTE_Ds; KeyOctave += 1; break; // s // // //
+
+ case 0xBA: KeyNote = NOTE_C; break; // ;
+ case 0x51: KeyNote = NOTE_D; break; // q
+ case 0x4A: KeyNote = NOTE_E; break; // j
+ case 0x4B: KeyNote = NOTE_F; break; // k
+ case 0x58: KeyNote = NOTE_G; break; // x
+ case 0x42: KeyNote = NOTE_A; break; // b
+ case 0x4D: KeyNote = NOTE_B; break; // m
+ case 0x57: KeyNote = NOTE_C; KeyOctave += 1; break; // w
+ case 0x56: KeyNote = NOTE_D; KeyOctave += 1; break; // v
+ case 0x5A: KeyNote = NOTE_E; KeyOctave += 1; break; // z // // //
}
// Invalid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.