mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-08 04:14:02 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3904b9503 | ||
|
|
28ee3bfc37 |
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
- Keep single-key app shortcuts off Cmd, Ctrl and Alt combinations, so Cmd+F,
|
||||||
|
Cmd+C and Cmd+R reach the browser instead of hiding the layer panel or
|
||||||
|
switching layers on. `F` now collapses the layer panel the way its button
|
||||||
|
does, instead of hiding the panel and the button that brings it back
|
||||||
|
(asturksever, #1598).
|
||||||
@@ -542,6 +542,7 @@ export class StyleManager extends ShellFacade {
|
|||||||
_toggleOrbit: (...args) => this._toggleOrbit(...args),
|
_toggleOrbit: (...args) => this._toggleOrbit(...args),
|
||||||
toggleCleanView: (...args) => this.toggleCleanView(...args),
|
toggleCleanView: (...args) => this.toggleCleanView(...args),
|
||||||
_toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args),
|
_toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args),
|
||||||
|
_togglePanel: (panelId) => this._panelChrome._togglePanel(panelId),
|
||||||
_setBloomEnabled: (...args) => this._setBloomEnabled(...args),
|
_setBloomEnabled: (...args) => this._setBloomEnabled(...args),
|
||||||
_setBloomIntensity: (...args) => this._setBloomIntensity(...args),
|
_setBloomIntensity: (...args) => this._setBloomIntensity(...args),
|
||||||
_setSharpenEnabled: (...args) => this._setSharpenEnabled(...args),
|
_setSharpenEnabled: (...args) => this._setSharpenEnabled(...args),
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ export function bindApplicationShortcuts({
|
|||||||
event.target?.matches?.('select, input, textarea') ||
|
event.target?.matches?.('select, input, textarea') ||
|
||||||
event.target === searchInput;
|
event.target === searchInput;
|
||||||
if (isFormControl && event.key !== 'Escape') return;
|
if (isFormControl && event.key !== 'Escape') return;
|
||||||
|
// Browser and OS shortcuts (Cmd+C, Ctrl+F, Alt+1…) are not ours.
|
||||||
|
if (event.metaKey || event.ctrlKey || event.altKey) {
|
||||||
|
if (event.key === 'Escape') actions.dismissSearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (STYLE_KEYS[event.key]) actions.setStyle(STYLE_KEYS[event.key]);
|
if (STYLE_KEYS[event.key]) actions.setStyle(STYLE_KEYS[event.key]);
|
||||||
if (event.key === 'Escape') actions.dismissSearch();
|
if (event.key === 'Escape') actions.dismissSearch();
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ export class DisplayBindings {
|
|||||||
},
|
},
|
||||||
toggleOrbit: () => this._toggleOrbit(),
|
toggleOrbit: () => this._toggleOrbit(),
|
||||||
toggleCleanView: () => this.toggleCleanView(),
|
toggleCleanView: () => this.toggleCleanView(),
|
||||||
toggleLayers: () =>
|
// Same collapse as the panel's own button, so its rail entry stays.
|
||||||
document.getElementById('data-panel').classList.toggle('active'),
|
toggleLayers: () => this._togglePanel('data-panel'),
|
||||||
cycleDetection: () => {
|
cycleDetection: () => {
|
||||||
this.shareLinkManager?.claimRestoreLane?.('visual');
|
this.shareLinkManager?.claimRestoreLane?.('visual');
|
||||||
this.claimDetection();
|
this.claimDetection();
|
||||||
|
|||||||
@@ -117,9 +117,19 @@ test('the supplied search target retains editing even without form markup', () =
|
|||||||
assert.deepEqual(f.calls, [['dismissSearch']]);
|
assert.deepEqual(f.calls, [['dismissSearch']]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('shortcut extraction does not change repeat or modifier policy', () => {
|
test('browser shortcuts with Cmd, Ctrl or Alt never reach app shortcuts', () => {
|
||||||
const f = shortcuts();
|
const f = shortcuts();
|
||||||
f.press('h', new Element(), { repeat: true, ctrlKey: true });
|
for (const modifier of ['metaKey', 'ctrlKey', 'altKey'])
|
||||||
|
for (const key of ['1', 'h', 'o', 'v', 'f', 'd', 'c'])
|
||||||
|
f.press(key, new Element(), { [modifier]: true });
|
||||||
|
assert.deepEqual(f.calls, []);
|
||||||
|
f.press('Escape', new Element(), { metaKey: true });
|
||||||
|
assert.deepEqual(f.calls, [['dismissSearch']]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('a held key still repeats its shortcut', () => {
|
||||||
|
const f = shortcuts();
|
||||||
|
f.press('h', new Element(), { repeat: true });
|
||||||
assert.deepEqual(f.calls, [['toggleHud']]);
|
assert.deepEqual(f.calls, [['toggleHud']]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user