Skip to content

Platform specific shortcuts for fullscreen toggle #962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/configuration/keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ move_right = "alt+l"
| `toggle_nick_list` | Toggle nick list | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>m</kbd> | <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>m</kbd> |
| `toggle_topic` | Toggle topic | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>t</kbd> | <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>t</kbd> |
| `toggle_sidebar` | Toggle sidebar | <kbd>⌘</kbd> + <kbd>⌥</kbd> + <kbd>b</kbd> | <kbd>ctrl</kbd> + <kbd>alt</kbd> + <kbd>b</kbd> |
| `toggle_fullscreen` | Toggle fullscreen | <kbd>ctrl</kbd> + <kbd></kbd> + <kbd>f</kbd> | <kbd>ctrl</kbd> + <kbd>shift</kbd> + <kbd>f</kbd> |
| `toggle_fullscreen` | Toggle fullscreen | <kbd></kbd> + <kbd>ctrl</kbd> + <kbd>f</kbd> | <kbd>F11</kbd> |
| `command_bar` | Toggle command bar | <kbd>⌘</kbd> + <kbd>k</kbd> | <kbd>ctrl</kbd> + <kbd>k</kbd> |
| `reload_configuration` | Refresh configuration file | <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>ctrl</kbd> + <kbd>r</kbd> |
| `file_transfers` | Toggle File Transfers Buffer | <kbd>⌘</kbd> + <kbd>j</kbd> | <kbd>ctrl</kbd> + <kbd>j</kbd> |
Expand Down
14 changes: 13 additions & 1 deletion data/src/shortcut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ impl Hash for KeyBind {
}
}

// For defaults checkt the platform specific defaults:
// macOS: https://support.apple.com/en-us/102650
// Windows: https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec
// Linux FreeDesktop (not ready yet): https://wiki.freedesktop.org/www/Specifications/default-keys-spec/
// Linux - KDE: https://docs.kde.org/stable5/en/khelpcenter/fundamentals/kbd.html
// Linux - Gnome: https://help.gnome.org/users/gnome-help/stable/keyboard-nav.html.en

impl KeyBind {
default!(move_up, ArrowUp, COMMAND | ALT);
default!(move_down, ArrowDown, COMMAND | ALT);
Expand All @@ -137,7 +144,12 @@ impl KeyBind {
default!(toggle_nick_list, "m", COMMAND | ALT);
default!(toggle_sidebar, "b", COMMAND | ALT);
default!(toggle_topic, "t", COMMAND | ALT);
default!(toggle_fullscreen, "f", CTRL | SHIFT);
#[cfg(target_os = "macos")]
default!(toggle_fullscreen, "f", COMMAND | CTRL);
#[cfg(target_os = "linux")]
default!(toggle_fullscreen, F11);
#[cfg(target_os = "windows")]
default!(toggle_fullscreen, F11);
default!(command_bar, "k", COMMAND);
default!(reload_configuration, "r", COMMAND);
default!(file_transfers, "j", COMMAND);
Expand Down