Skip to content

Commit 0ac2a22

Browse files
committed
📝 Update sound theme docs
1 parent 3161be1 commit 0ac2a22

2 files changed

Lines changed: 46 additions & 6 deletions

File tree

src/content/docs/config-files.mdx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Below are the default values of the configuration file.
7979

8080
```json title="config.json"
8181
{
82-
"version": "2.1.0",
82+
"version": "3.0.0",
8383
"locale": "auto",
8484
"showIntroductionDialog": true,
8585
"menuTheme": "default",
@@ -101,6 +101,7 @@ Below are the default values of the configuration file.
101101
"hideSettingsButton": false,
102102
"settingsButtonPosition": "bottom-right",
103103
"windowsInkWorkaround": true,
104+
"maxSelectionRadius": 0,
104105
"centerDeadZone": 50,
105106
"minParentDistance": 150,
106107
"dragThreshold": 15,
@@ -112,6 +113,7 @@ Below are the default values of the configuration file.
112113
"enableMarkingMode": true,
113114
"enableTurboMode": true,
114115
"warpMouse": true,
116+
"returnPointerToMenuOpeningPosition": false,
115117
"hoverModeNeedsConfirmation": false,
116118
"gestureMinStrokeLength": 150,
117119
"gestureMinStrokeAngle": 20,
@@ -278,12 +280,18 @@ If true, the settings button will be hidden if not hovered.
278280
The position of the settings button.
279281
Can be one of `'top-left'`, `'top-right'`, `'bottom-left'`, or `'bottom-right'`.
280282

281-
#### windowsInkWorkaround <Badge text="new!" variant="tip" />
283+
#### windowsInkWorkaround
282284

283285
<small>Default value: `"windowsInkWorkaround": true`</small>
284286

285287
If true, the menu will introduce a delay of 100ms before opening on Windows to work around the issue where getting the stylus position is otherwise not possible.
286288

289+
#### maxSelectionRadius <Badge text="new!" variant="tip" />
290+
291+
<small>Default value: `"maxSelectionRadius": 0`</small>
292+
293+
If set to a value greater than 0, the menu will be closed if the user clicks outside of the menu and the distance to the center of the menu is greater than this value (in pixels).
294+
287295
#### centerDeadZone
288296

289297
<small>Default value: `"centerDeadZone": 50`</small>
@@ -351,6 +359,12 @@ If enabled, items can be selected by hovering over them while holding down a key
351359

352360
If true, the mouse pointer will be warped to the center of the menu when necessary.
353361

362+
#### returnPointerToMenuOpeningPosition <Badge text="new!" variant="tip" />
363+
364+
<small>Default value: `"returnPointerToMenuOpeningPosition": false`</small>
365+
366+
If enabled, the mouse pointer will be returned to its original position when the menu is closed.
367+
354368
#### hoverModeNeedsConfirmation
355369

356370
<small>Default value: `"hoverModeNeedsConfirmation": false`</small>

src/content/docs/create-sound-themes.mdx

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ You can also name this file `theme.json`. But [JSON5](https://json5.org/) is a b
9797
license: 'CC0-1.0',
9898
themeVersion: '1.0',
9999

100-
// This theme was created for Kando's sound theme engine version 1.
100+
// This theme was created for Kando's sound theme engine version 2.
101101
// Kando will use this to check if the theme is compatible with the
102102
// current version of Kando.
103-
engineVersion: 1,
103+
engineVersion: 2,
104104

105105
// This is a list of sound files which are played when certain events
106106
// occur in the menu.
@@ -112,7 +112,7 @@ You can also name this file `theme.json`. But [JSON5](https://json5.org/) is a b
112112
file: "close.mp3",
113113
volume: 0.5,
114114
},
115-
hoverItem: {
115+
hoverButton: {
116116
file: "hover.mp3",
117117
minPitch: 0.9,
118118
maxPitch: 1.1,
@@ -127,6 +127,29 @@ The following events are available for sound themes.
127127
For each event, you can specify a sound file which is played when the event occurs.
128128
It is perfectly fine to reuse the same sound file for multiple events.
129129

130+
<Aside type="note">
131+
With Kando 3.0, the set of available sound events has changed. Use the tabs below to see which events are available now.
132+
</Aside>
133+
134+
<Tabs>
135+
<TabItem label="Kando 3.0+ (Engine Version 2)">
136+
137+
<div style="width:120px">Event</div> | Description
138+
--- | ---
139+
`openMenu` | This event is triggered when a menu is opened.
140+
`openSubmenu` | This event is triggered when a submenu is opened.
141+
`closeMenu` | This event is triggered when a menu is closed. It will play when the close-menu action is executed, regardless of whether an item was selected or not.
142+
`closeSubmenu` | This event is triggered when a submenu is closed.
143+
`hoverParent` | This event is triggered when the parent of the current center item is hovered with the mouse.
144+
`hoverCenter` | This event is triggered when the current center item is hovered with the mouse.
145+
`hoverButton` | This event is triggered when a leaf item is hovered with the mouse.
146+
`hoverSubmenu` | This event is triggered when a submenu which could be opened is hovered with the mouse.
147+
`selectButton` | This event is triggered when an action is executed by selecting an item.
148+
`activateMenu` | This event is triggered when the center of a submenu is selected.
149+
150+
</TabItem>
151+
<TabItem label="Kando 2.x (Engine Version 1)">
152+
130153
<div style="width:120px">Event</div> | Description
131154
--- | ---
132155
`openMenu` | This event is triggered when a menu is opened.
@@ -138,6 +161,9 @@ It is perfectly fine to reuse the same sound file for multiple events.
138161
`selectParent` | This event is triggered when the user navigates to the parent of the current center item.
139162
`selectSubmenu` | This event is triggered when a submenu is opened.
140163

164+
</TabItem>
165+
</Tabs>
166+
141167
### Advanced Configuration
142168

143169
For each event, you can specify the volume of the sound file and the pitch of the sound file.
@@ -147,7 +173,7 @@ You can set them to the same value to play the sound file with a fixed pitch.
147173

148174
```json5 title="theme.json5" {4-6}
149175
// ...
150-
hoverItem: {
176+
openMenu: {
151177
file: "hover.mp3",
152178
volume: 0.5,
153179
minPitch: 0.9,

0 commit comments

Comments
 (0)