Skip to content

Commit 0acc2d5

Browse files
committed
refactor(toolbar): use Ctrl+Shift+F shortcut
Replace access+w (Ctrl+Option+W / Alt+Shift+W) with Ctrl+Shift+F. Unified across all platforms, no per-OS modifier branching needed.
1 parent 6034341 commit 0acc2d5

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/js/_enqueues/lib/admin-bar.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
skipLink,
2424
mobileEvent,
2525
adminBarSearchInput,
26-
isMac = /Mac|iPhone|iPad|iPod/.test( navigator.platform ),
2726
i;
2827

2928
if ( ! adminBar || ! ( 'querySelectorAll' in adminBar ) ) {
@@ -110,22 +109,10 @@
110109
adminBarLogout.addEventListener( 'click', emptySessionStorage );
111110
}
112111

113-
// Toggle toolbar visibility with access+w keyboard shortcut (frontend only).
112+
// Toggle toolbar visibility with Ctrl+Shift+F keyboard shortcut (frontend only).
114113
if ( ! document.body.classList.contains( 'wp-admin' ) ) {
115114
document.addEventListener( 'keydown', function( event ) {
116-
var isAccessModifier;
117-
118-
if ( event.which !== 87 ) { // 'W' key.
119-
return;
120-
}
121-
122-
if ( isMac ) {
123-
isAccessModifier = event.ctrlKey && event.altKey && ! event.metaKey && ! event.shiftKey;
124-
} else {
125-
isAccessModifier = event.altKey && event.shiftKey && ! event.ctrlKey && ! event.metaKey;
126-
}
127-
128-
if ( ! isAccessModifier ) {
115+
if ( event.which !== 70 || ! event.ctrlKey || ! event.shiftKey || event.altKey || event.metaKey ) { // Ctrl+Shift+F.
129116
return;
130117
}
131118

src/wp-includes/css/admin-bar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ html:lang(he-il) .rtl #wpadminbar * {
105105
/**
106106
* Toolbar toggle hidden state.
107107
*
108-
* Toggled via access+w keyboard shortcut on the frontend.
108+
* Toggled via Ctrl+Shift+F keyboard shortcut on the frontend.
109109
* Sets the admin bar height variable to 0 so all dependent spacing
110110
* (scroll-padding, bump margin) adjusts automatically.
111111
*/

0 commit comments

Comments
 (0)