Started working on keyboard shortcuts

This commit is contained in:
Mauro Balades
2024-08-08 17:44:45 +02:00
parent 4402ed8fc1
commit cc024a4528
8 changed files with 27 additions and 4 deletions

View File

@@ -130,6 +130,7 @@ jobs:
source:
if: false
permissions:
contents: write
runs-on: ubuntu-latest

View File

@@ -28,7 +28,7 @@ Zen is built with performance in mind, and we have optimized the browser to be a
Clone the project
```bash
git clone https://github.com/zen-browser/desktop.git --recursive
git clone https://github.com/zen-browser/desktop.git
cd desktop
```

19
docs/key-shortcuts.md Normal file
View File

@@ -0,0 +1,19 @@
# Custom Keyboard Shortcuts
```json
{
"<shortcut-id>": {
"key": "<key>",
"alt": false,
"shift": false,
"ctrl": false,
"meta": false,
"keycode": 0
}
}
```
The `key` field is the key that will trigger the shortcut. The `alt`, `shift`, `ctrl`, and `meta` fields are booleans that indicate if the respective modifier key should be pressed when the shortcut is triggered.
The `keycode` field is the keycode of the key that will trigger the shortcut. This field is optional and can be used to specify the keycode of the key that will trigger the shortcut. If the `keycode` field is specified, the `key` field will be ignored.

View File

@@ -1,7 +1,7 @@
# Workspaces Layout
```
```json
{
"workspaces": [
{

View File

@@ -71,6 +71,7 @@ pref('zen.view.compact.hide-toolbar', false);
pref('zen.view.sidebar-expanded', false);
pref('zen.view.sidebar-expanded.show-button', true);
pref('zen.view.sidebar-expanded.max-width', 400);
pref('zen.keyboard.shortcuts', "{}");
// Pref to enable the new profiles (TODO: Check this out!)
//pref("browser.profiles.enabled", true);

View File

@@ -5,5 +5,6 @@ window.addEventListener("DOMContentLoaded", async () => {
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenWorkspaces.mjs");
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenViewSplitter.mjs");
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenProfileDialogUI.mjs");
Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenKeyboardShortcuts.mjs");
}, { once: true });
</script>

View File

@@ -3,5 +3,6 @@
content/browser/zen-components/ZenViewSplitter.mjs (content/zen-components/src/ZenViewSplitter.mjs)
content/browser/zen-components/ZenWorkspaces.mjs (content/zen-components/src/ZenWorkspaces.mjs)
content/browser/zen-components/ZenSidebarManager.mjs (content/zen-components/src/ZenSidebarManager.mjs)
content/browser/zen-components/ZenProfileDialogUI.mjs (content/zen-components/src/ZenProfileDialogUI.mjs)
content/browser/zen-components/ZenProfileDialogUI.mjs (content/zen-components/src/ZenProfileDialogUI.mjs)
content/browser/zen-components/ZenKeyboardShortcuts.mjs (content/zen-components/src/ZenKeyboardShortcuts.mjs)