qdesk 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -56,7 +56,6 @@ let activeRecording;
56
56
  let awaitingChordRemoval = false;
57
57
  const toolWindowAtStartup = getActiveWindowHandleAndName() ?? undefined;
58
58
  console.log("[info] Tool window at startup:", toolWindowAtStartup?.name ?? "(unknown)");
59
- let removalReturnWindow;
60
59
  const listener = startListening({
61
60
  onEscape: (stopPropagating) => {
62
61
  if (!activeRecording && !awaitingChordRemoval) {
@@ -75,6 +74,7 @@ const listener = startListening({
75
74
  stopPropagating();
76
75
  },
77
76
  onChord: (chord, stopPropagating) => {
77
+ // recording
78
78
  if (activeRecording) {
79
79
  if ([ADD_CHORD, DROP_CHORD].includes(chord)) {
80
80
  console.warn(`[warn] Ignoring ${chord} chord during active recording to avoid conflicts.`);
@@ -87,6 +87,7 @@ const listener = startListening({
87
87
  printBindings();
88
88
  return stopPropagating();
89
89
  }
90
+ // removing
90
91
  if (awaitingChordRemoval) {
91
92
  awaitingChordRemoval = false;
92
93
  setScreenHue("off");
@@ -99,6 +100,7 @@ const listener = startListening({
99
100
  printBindings();
100
101
  return stopPropagating();
101
102
  }
103
+ // trigger recording
102
104
  if (chord === ADD_CHORD) {
103
105
  awaitingChordRemoval = false;
104
106
  setScreenHue("off");
@@ -112,6 +114,7 @@ const listener = startListening({
112
114
  }
113
115
  return stopPropagating();
114
116
  }
117
+ // trigger removing
115
118
  if (chord === DROP_CHORD) {
116
119
  if (activeRecording) {
117
120
  activeRecording = undefined;
@@ -126,6 +129,7 @@ const listener = startListening({
126
129
  setScreenHue("remove");
127
130
  return stopPropagating();
128
131
  }
132
+ // switching
129
133
  const binding = bindings.get(chord);
130
134
  if (binding) {
131
135
  const result = activateWindowByHandle(binding.handle);
@@ -134,6 +138,7 @@ const listener = startListening({
134
138
  bindings.delete(chord);
135
139
  }
136
140
  else if (result === "activated") {
141
+ binding.name = getActiveWindowHandleAndName()?.name ?? binding.name; // warm the cache to speed up subsequent switches
137
142
  console.log(`[binding ${chord}] Switched to "${binding.name}"`);
138
143
  }
139
144
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdesk",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",