aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-07-05 21:20:30 -0700
committerPinapelz <yukais@pinapelz.com>2025-07-05 21:20:30 -0700
commit86e61c1052d7193f87e47d701dcbe44602105d12 (patch)
tree6a4271c23011ae48ce63f6d6edf980a0fd786a91
parent8700614040de0b3a2e1d37a30fbc73141043a1da (diff)
add configurable keybinds and fix air input keybind ordering1.1
-rw-r--r--README.md4
-rw-r--r--chuniio_key_config.json44
-rw-r--r--key_config.json44
-rw-r--r--key_config.py118
4 files changed, 164 insertions, 46 deletions
diff --git a/README.md b/README.md
index f0f6bfb..e0315a4 100644
--- a/README.md
+++ b/README.md
@@ -21,4 +21,6 @@ Run `Brokenithm-Evolved-iOS-Umi.exe`
> You must launch the server before Umiguri. If Umiguri is already opened you will need to restart the game.
# Config
-By default no configuration is required. This application will use UMIGURI's 32-zone keyboard layout. 32-zone input is supported, but you will need to find a client that also supports 32-zones of input. \ No newline at end of file
+By default no configuration is required. This application will use UMIGURI's 32-zone keyboard layout. 32-zone input is supported, but you will need to find a client that also supports 32-zones of input (with the exception of air-zones). The default config can be found in `key_config.json`
+
+Due to how the iOS clients above were programmed, the AIR ZONES are out of order due to some IO differences. In the default `key_config.json` this has been adjusted to fix the order when outputting keybinds. However, if for any reason you require the original order then replace the contents `key_config.json` with whats inside `chuniio_key_config.json`
diff --git a/chuniio_key_config.json b/chuniio_key_config.json
new file mode 100644
index 0000000..dfb0c50
--- /dev/null
+++ b/chuniio_key_config.json
@@ -0,0 +1,44 @@
+{
+ "keyzone": {
+ "31": "a",
+ "30": "1",
+ "29": "z",
+ "28": "q",
+ "27": "s",
+ "26": "2",
+ "25": "x",
+ "24": "w",
+ "23": "d",
+ "22": "3",
+ "21": "c",
+ "20": "e",
+ "19": "f",
+ "18": "4",
+ "17": "v",
+ "16": "r",
+ "15": "g",
+ "14": "5",
+ "13": "b",
+ "12": "t",
+ "11": "h",
+ "10": "6",
+ "9": "n",
+ "8": "y",
+ "7": "j",
+ "6": "7",
+ "5": "m",
+ "4": "u",
+ "3": "k",
+ "2": "8",
+ "1": "9",
+ "0": "i"
+ },
+ "airzone": {
+ "0": "0",
+ "1": "o",
+ "2": "l",
+ "3": "p",
+ "4": ".",
+ "5": ","
+ }
+} \ No newline at end of file
diff --git a/key_config.json b/key_config.json
new file mode 100644
index 0000000..dfb0c50
--- /dev/null
+++ b/key_config.json
@@ -0,0 +1,44 @@
+{
+ "keyzone": {
+ "31": "a",
+ "30": "1",
+ "29": "z",
+ "28": "q",
+ "27": "s",
+ "26": "2",
+ "25": "x",
+ "24": "w",
+ "23": "d",
+ "22": "3",
+ "21": "c",
+ "20": "e",
+ "19": "f",
+ "18": "4",
+ "17": "v",
+ "16": "r",
+ "15": "g",
+ "14": "5",
+ "13": "b",
+ "12": "t",
+ "11": "h",
+ "10": "6",
+ "9": "n",
+ "8": "y",
+ "7": "j",
+ "6": "7",
+ "5": "m",
+ "4": "u",
+ "3": "k",
+ "2": "8",
+ "1": "9",
+ "0": "i"
+ },
+ "airzone": {
+ "0": "0",
+ "1": "o",
+ "2": "l",
+ "3": "p",
+ "4": ".",
+ "5": ","
+ }
+} \ No newline at end of file
diff --git a/key_config.py b/key_config.py
index eaa2be2..f0cc348 100644
--- a/key_config.py
+++ b/key_config.py
@@ -1,63 +1,91 @@
+import json
+import os
from abc import ABC, abstractmethod
+CONFIG_PATH = "key_config.json"
+
class InputConfig(ABC):
@abstractmethod
- def get_keyzone_layout():
+ def get_keyzone_layout(self):
pass
@abstractmethod
- def get_airzone_layout():
+ def get_airzone_layout(self):
pass
class Umiguri32KeyZone(InputConfig):
def __init__(self):
super().__init__()
- self._UMIGIRI_32_KEYZONE_LAYOUT = {
- 31: "a",
- 30: "1",
- 29: "z",
- 28: "q",
- 27: "s",
- 26: "2",
- 25: "x",
- 24: "w",
- 23: "d",
- 22: "3",
- 21: "c",
- 20: "e",
- 19: "f",
- 18: "4",
- 17: "v",
- 16: "r",
- 15: "g",
- 14: "5",
- 13: "b",
- 12: "t",
- 11: "h",
- 10: "6",
- 9: "n",
- 8: "y",
- 7: "j",
- 6: "7",
- 5: "m",
- 4: "u",
- 3: "k",
- 2: "8",
- 1: "9",
- 0: "i",
- }
- self._UMIGIRI_32_AIRZONE_LAYOUT = {
- 0: "o",
- 1: "0",
- 2: "p",
- 3: "l",
- 4: ",",
- 5: ".",
- }
-
+ if os.path.exists(CONFIG_PATH):
+ with open(CONFIG_PATH, "r") as f:
+ config = json.load(f)
+ self._UMIGIRI_32_KEYZONE_LAYOUT = {
+ int(k): v for k, v in config["keyzone"].items()
+ }
+ self._UMIGIRI_32_AIRZONE_LAYOUT = {
+ int(k): v for k, v in config["airzone"].items()
+ }
+ else:
+ self._UMIGIRI_32_KEYZONE_LAYOUT = {
+ 31: "a",
+ 30: "1",
+ 29: "z",
+ 28: "q",
+ 27: "s",
+ 26: "2",
+ 25: "x",
+ 24: "w",
+ 23: "d",
+ 22: "3",
+ 21: "c",
+ 20: "e",
+ 19: "f",
+ 18: "4",
+ 17: "v",
+ 16: "r",
+ 15: "g",
+ 14: "5",
+ 13: "b",
+ 12: "t",
+ 11: "h",
+ 10: "6",
+ 9: "n",
+ 8: "y",
+ 7: "j",
+ 6: "7",
+ 5: "m",
+ 4: "u",
+ 3: "k",
+ 2: "8",
+ 1: "9",
+ 0: "i",
+ }
+
+ self._UMIGIRI_32_AIRZONE_LAYOUT = {
+ 0: "o",
+ 1: "0",
+ 2: "p",
+ 3: "l",
+ 4: ",",
+ 5: ".",
+ }
+
+ self._save_default_config()
+
+ def _save_default_config(self):
+ with open(CONFIG_PATH, "w") as f:
+ json.dump(
+ {
+ "keyzone": self._UMIGIRI_32_KEYZONE_LAYOUT,
+ "airzone": self._UMIGIRI_32_AIRZONE_LAYOUT,
+ },
+ f,
+ indent=4,
+ )
+
def get_keyzone_layout(self):
return self._UMIGIRI_32_KEYZONE_LAYOUT
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage