diff --git a/data_json.json b/data_json.json new file mode 100644 index 00000000..5a51b59f --- /dev/null +++ b/data_json.json @@ -0,0 +1,581 @@ +{ + "data": [ + { + "name": "Default", + "icon": "i", + "macros": [ + { + "name": "Havo", + "sequence": [ + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 20, + "keytype": "DownUp" + } + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 10, + "press_duration": 20, + "keytype": "DownUp" + } + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 20, + "keytype": "DownUp" + } + } + ], + "macro_type": "Single", + "trigger": { + "type": "KeyPressEvent", + "data": [ + { + "keypress": 51, + "press_duration": 0, + "keytype": "DownUp" + } + ], + "allow_while_other_keys": false + }, + "active": true + }, + { + "name": "macro 5", + "sequence": [ + { + "type": "KeyPressEvent", + "data": { + "keypress": 4, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 5, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "Delay", + "data": 50 + } + ], + "macro_type": "Single", + "trigger": { + "type": "KeyPressEvent", + "data": [ + { + "keypress": 84, + "press_duration": 0, + "keytype": "Down" + } + ], + "allow_while_other_keys": false + }, + "active": true + } + ], + "active": true + }, + { + "name": "test", + "icon": "i", + "macros": [ + { + "name": "Test Macro 1", + "sequence": [ + { + "type": "KeyPressEvent", + "data": { + "keypress": 8, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "Delay", + "data": 50 + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 7, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 6, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 14, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 11, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 11, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 11, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 10, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 12, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 16, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 11, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 11, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 17, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 15, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 13, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 12, + "press_duration": 1, + "keytype": "DownUp" + } + } + ], + "macro_type": "Single", + "trigger": { + "type": "KeyPressEvent", + "data": [ + { + "keypress": 224, + "press_duration": 0, + "keytype": "Down" + }, + { + "keypress": 15, + "press_duration": 0, + "keytype": "Down" + } + ], + "allow_while_other_keys": false + }, + "active": true + }, + { + "name": "test 2", + "sequence": [ + { + "type": "KeyPressEvent", + "data": { + "keypress": 4, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 8, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 10, + "press_duration": 1, + "keytype": "DownUp" + } + }, + { + "type": "KeyPressEvent", + "data": { + "keypress": 9, + "press_duration": 1, + "keytype": "DownUp" + } + } + ], + "macro_type": "Single", + "trigger": { + "type": "KeyPressEvent", + "data": [ + { + "keypress": 4, + "press_duration": 0, + "keytype": "Down" + }, + { + "keypress": 22, + "press_duration": 0, + "keytype": "Down" + }, + { + "keypress": 7, + "press_duration": 0, + "keytype": "Down" + } + ], + "allow_while_other_keys": false + }, + "active": true + } + ], + "active": true + } + ] +} \ No newline at end of file diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 802bce25..f5969970 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -91,11 +91,14 @@ async fn main() { // Begin the main event loop. This loop cannot run on another thread on MacOS. let quit = CustomMenuItem::new("quit".to_string(), "Quit"); let hide = CustomMenuItem::new("hide".to_string(), "Hide"); + let show = CustomMenuItem::new("show".to_string(), "Show"); let tray_menu = SystemTrayMenu::new() - .add_item(quit) + .add_item(hide) .add_native_item(SystemTrayMenuItem::Separator) - .add_item(hide); + .add_item(quit) + .add_item(show); + let system_tray = SystemTray::new().with_menu(tray_menu); diff --git a/src/components/macroview/SequencingArea.tsx b/src/components/macroview/SequencingArea.tsx index 5fe71253..b953fdf4 100644 --- a/src/components/macroview/SequencingArea.tsx +++ b/src/components/macroview/SequencingArea.tsx @@ -63,6 +63,8 @@ export default function SequencingArea() { if (active.id !== over.id) { const oldIndex = ids.indexOf(active.id) const newIndex = ids.indexOf(over.id) + console.log(oldIndex) + console.log(newIndex) overwriteIds(arrayMove(ids, oldIndex, newIndex)) } setActiveId(undefined)