-
Notifications
You must be signed in to change notification settings - Fork 1
/
MihoyoVirtualKeyMap.cs
68 lines (63 loc) · 2.05 KB
/
MihoyoVirtualKeyMap.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System.Collections.Generic;
using WindowsInput.Native;
namespace GenshinLyrePlayer
{
public static class MihoyoVirtualKeyMap
{
public static VirtualKeyCode GetKeyForTransposedNote(int note, int transpose)
{
return GetKeyForNote(note + transpose);
}
private static VirtualKeyCode GetKeyForNote(int note)
{
switch (note)
{
// C3
case 48:
return VirtualKeyCode.VK_Z;
case 50:
return VirtualKeyCode.VK_X;
case 52:
return VirtualKeyCode.VK_C;
case 53:
return VirtualKeyCode.VK_V;
case 55:
return VirtualKeyCode.VK_B;
case 57:
return VirtualKeyCode.VK_N;
case 59:
return VirtualKeyCode.VK_M;
// C4
case 60:
return VirtualKeyCode.VK_A;
case 62:
return VirtualKeyCode.VK_S;
case 64:
return VirtualKeyCode.VK_D;
case 65:
return VirtualKeyCode.VK_F;
case 67:
return VirtualKeyCode.VK_G;
case 69:
return VirtualKeyCode.VK_H;
case 71:
return VirtualKeyCode.VK_J;
case 72:
return VirtualKeyCode.VK_Q;
case 74:
return VirtualKeyCode.VK_W;
case 76:
return VirtualKeyCode.VK_E;
case 77:
return VirtualKeyCode.VK_R;
case 79:
return VirtualKeyCode.VK_T;
case 81:
return VirtualKeyCode.VK_Y;
case 83:
return VirtualKeyCode.VK_U;
}
return VirtualKeyCode.ESCAPE;
}
}
}