[Update] Save and register -able.

This commit is contained in:
Sakamoto Shiina
2025-01-13 05:39:25 +09:00
parent a76ea77d5d
commit 34d221c437
9 changed files with 98 additions and 18 deletions

View File

@@ -1,24 +1,23 @@
import { useStore_Hotkeys } from "@store";
// import { useStdoutToPython } from "@logics/useStdoutToPython";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useHotkeys = () => {
// const { asyncStdoutToPython } = useStdoutToPython();
const { asyncStdoutToPython } = useStdoutToPython();
const { currentHotkeys, updateHotkeys, pendingHotkeys } = useStore_Hotkeys();
const getHotkeys = () => {
// pendingHotkeys();
// asyncStdoutToPython("/get/data/osc_ip_address");
pendingHotkeys();
asyncStdoutToPython("/get/data/hotkeys");
};
const setHotkeys = (hotkeys) => {
updateHotkeys(hotkeys);
// pendingHotkeys();
// asyncStdoutToPython("/set/data/osc_ip_address", osc_ip_address);
pendingHotkeys();
asyncStdoutToPython("/set/data/hotkeys", hotkeys);
};
return {
currentHotkeys,
// getHotkeys,
getHotkeys,
updateHotkeys,
setHotkeys,
};

View File

@@ -68,6 +68,7 @@ import {
useIsEnabledOverlayLargeLog,
useOverlayLargeLogSettings,
useOverlayShowOnlyTranslatedMessages,
useHotkeys,
useOscIpAddress,
useOscPort,
} from "@logics_configs";
@@ -168,6 +169,8 @@ export const useReceiveRoutes = () => {
const { updateIsEnabledOverlayLargeLog } = useIsEnabledOverlayLargeLog();
const { updateOverlayShowOnlyTranslatedMessages } = useOverlayShowOnlyTranslatedMessages();
const { updateHotkeys } = useHotkeys();
const { updateOscIpAddress } = useOscIpAddress();
const { updateOscPort } = useOscPort();
@@ -458,6 +461,10 @@ export const useReceiveRoutes = () => {
"/set/enable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
"/set/disable/send_received_message_to_vrc": updateEnableSendReceivedMessageToVrc,
// Hotkeys
"/get/data/hotkeys": updateHotkeys,
"/set/data/hotkeys": updateHotkeys,
// Advanced Settings
"/get/data/osc_ip_address": updateOscIpAddress,
"/set/data/osc_ip_address": updateOscIpAddress,