| 1 | import { Mac } from "../src/Mac.ts"; |
| 2 | import { SpeedEditor } from "../src/SpeedEditor.ts"; |
| 3 | |
| 4 | const editor = await SpeedEditor.open(); |
| 5 | const mac = await Mac.open(); |
| 6 | |
| 7 | editor.on("jog", (ev) => { |
| 8 | console.info(ev); |
| 9 | }); |
| 10 | editor.on("keypress", (key) => { |
| 11 | console.info(`Press ${key}`); |
| 12 | |
| 13 | if (key === "smartInsert") { |
| 14 | mac.focusApp("com.google.Chrome"); |
| 15 | } |
| 16 | }); |
| 17 | editor.onDoublePress("transition", () => { |
| 18 | console.info("(double press) \"Title\""); |
| 19 | }); |
| 20 | |
| 21 | console.info("init"); |
| 22 | mac.on("app-change", (bundle) => { |
| 23 | console.info(`Switch to ${bundle}`); |
| 24 | }); |