[+] Custom Keymap

pull/55/head
Clansty 2024-10-02 14:41:20 +08:00
parent c15dcf6b98
commit 1bcb7210c6
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
2 changed files with 34 additions and 5 deletions

View File

@ -1,5 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Tomlet.Attributes;
using AquaMai.CustomKeyMap;
namespace AquaMai
{
@ -13,6 +13,7 @@ namespace AquaMai
public TimeSavingConfig TimeSaving { get; set; } = new();
public WindowStateConfig WindowState { get; set; } = new();
public TouchSensitivityConfig TouchSensitivity { get; set; } = new();
public CustomKeyMapConfig CustomKeyMap { get; set; } = new();
public class CheatConfig
{
@ -126,7 +127,26 @@ namespace AquaMai
public class CustomKeyMapConfig
{
public bool Enable { get; set; }
public string[] KeyMap { get; set; } = new string[0];
public KeyCodeID Test { get; set; } = (KeyCodeID)115;
public KeyCodeID Service { get; set; } = (KeyCodeID)5;
public KeyCodeID Button1_1P { get; set; } = (KeyCodeID)67;
public KeyCodeID Button2_1P { get; set; } = (KeyCodeID)49;
public KeyCodeID Button3_1P { get; set; } = (KeyCodeID)48;
public KeyCodeID Button4_1P { get; set; } = (KeyCodeID)47;
public KeyCodeID Button5_1P { get; set; } = (KeyCodeID)68;
public KeyCodeID Button6_1P { get; set; } = (KeyCodeID)70;
public KeyCodeID Button7_1P { get; set; } = (KeyCodeID)45;
public KeyCodeID Button8_1P { get; set; } = (KeyCodeID)61;
public KeyCodeID Select_1P { get; set; } = (KeyCodeID)25;
public KeyCodeID Button1_2P { get; set; } = (KeyCodeID)80;
public KeyCodeID Button2_2P { get; set; } = (KeyCodeID)81;
public KeyCodeID Button3_2P { get; set; } = (KeyCodeID)78;
public KeyCodeID Button4_2P { get; set; } = (KeyCodeID)75;
public KeyCodeID Button5_2P { get; set; } = (KeyCodeID)74;
public KeyCodeID Button6_2P { get; set; } = (KeyCodeID)73;
public KeyCodeID Button7_2P { get; set; } = (KeyCodeID)76;
public KeyCodeID Button8_2P { get; set; } = (KeyCodeID)79;
public KeyCodeID Select_2P { get; set; } = (KeyCodeID)84;
}
}
}

View File

@ -1,6 +1,15 @@
namespace AquaMai.CustomKeyMap;
using DB;
using HarmonyLib;
namespace AquaMai.CustomKeyMap;
public class Enable
{
}
[HarmonyPatch(typeof(JvsButtonTableRecord), MethodType.Constructor, typeof(int), typeof(string), typeof(string), typeof(int), typeof(string), typeof(int), typeof(int), typeof(int))]
[HarmonyPostfix]
public static void JvsButtonTableRecordConstructor(JvsButtonTableRecord __instance, string Name)
{
var prop = (DB.KeyCodeID)typeof(Config.CustomKeyMapConfig).GetProperty(Name).GetValue(AquaMai.AppConfig.CustomKeyMap);
__instance.SubstituteKey = prop;
}
}