mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
refactor(ui): extract application shortcuts and parameter controls
This commit is contained in:
1 parent
5fa8db1686
commit
7a5f615d55
14 files changed
+469
-92
No files matched your search
@@ -569,7 +569,13 @@ try {
|
||||
trusted: event.isTrusted, detail: event.detail ?? null,
|
||||
style: event.target.closest('.style-btn')?.dataset.style || null,
|
||||
});
|
||||
for (const type of ['keydown', 'keyup', 'click']) grid.addEventListener(type, record, true);
|
||||
// A claimed hold deliberately blurs the button. Repeats and release then
|
||||
// target the document body, so observe Space beyond the original grid.
|
||||
const recordSpace = (event) => {
|
||||
if (event.code === 'Space') record(event);
|
||||
};
|
||||
for (const type of ['keydown', 'keyup']) document.addEventListener(type, recordSpace, true);
|
||||
grid.addEventListener('click', record, true);
|
||||
manager.setStyle = function (...args) {
|
||||
probe.activations.push(args[0]);
|
||||
return originalSetStyle.apply(this, args);
|
||||
@@ -609,7 +615,8 @@ try {
|
||||
manager.setStyle = originalSetStyle;
|
||||
voice.start = originalVoiceStart;
|
||||
observer.disconnect();
|
||||
for (const type of ['keydown', 'keyup', 'click']) grid.removeEventListener(type, record, true);
|
||||
for (const type of ['keydown', 'keyup']) document.removeEventListener(type, recordSpace, true);
|
||||
grid.removeEventListener('click', record, true);
|
||||
};
|
||||
window.__qaStyleKeyProbe = probe;
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user