mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 19:34:01 +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),
|
||||
toggleCleanView: (...args) => this.toggleCleanView(...args),
|
||||
_toggleCctvEnabled: (...args) => this._toggleCctvEnabled(...args),
|
||||
_togglePanel: (panelId) => this._panelChrome._togglePanel(panelId),
|
||||
_setBloomEnabled: (...args) => this._setBloomEnabled(...args),
|
||||
_setBloomIntensity: (...args) => this._setBloomIntensity(...args),
|
||||
_setSharpenEnabled: (...args) => this._setSharpenEnabled(...args),
|
||||
|
||||
@@ -27,6 +27,11 @@ export function bindApplicationShortcuts({
|
||||
event.target?.matches?.('select, input, textarea') ||
|
||||
event.target === searchInput;
|
||||
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 (event.key === 'Escape') actions.dismissSearch();
|
||||
|
||||
@@ -64,8 +64,8 @@ export class DisplayBindings {
|
||||
},
|
||||
toggleOrbit: () => this._toggleOrbit(),
|
||||
toggleCleanView: () => this.toggleCleanView(),
|
||||
toggleLayers: () =>
|
||||
document.getElementById('data-panel').classList.toggle('active'),
|
||||
// Same collapse as the panel's own button, so its rail entry stays.
|
||||
toggleLayers: () => this._togglePanel('data-panel'),
|
||||
cycleDetection: () => {
|
||||
this.shareLinkManager?.claimRestoreLane?.('visual');
|
||||
this.claimDetection();
|
||||
|
||||
@@ -117,9 +117,19 @@ test('the supplied search target retains editing even without form markup', () =
|
||||
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();
|
||||
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']]);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user