[Update] Save and register -able.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user