Skip to content

Commit

Permalink
Started working on keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Aug 8, 2024
1 parent 4402ed8 commit cc024a4
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
source:
if: false
permissions:
contents: write
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
19 changes: 19 additions & 0 deletions docs/key-shortcuts.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion docs/workspaces.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Workspaces Layout

```
```json
{
"workspaces": [
{
Expand Down
1 change: 1 addition & 0 deletions src/browser/app/profile/zen-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/browser/base/content/zen-components
1 change: 1 addition & 0 deletions src/browser/base/content/zen-scripts.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
3 changes: 2 additions & 1 deletion src/browser/base/content/zen-scripts.jar.inc.mn
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit cc024a4

Please sign in to comment.