Skip to content

Commit a98a96e

Browse files
committed
fixed app documentation
1 parent bacbb13 commit a98a96e

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

docs/_sidebar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Plugins
44
- [Accessibility](/plugins/accessibility.md)
5+
- [App](/plugins/app.md)
56
- [Utils](/plugins/utils.md)
67
- [Storage](/plugins/storage.md)
78
- [Settings](/plugins/settings.md)
@@ -28,7 +29,6 @@
2829
- [VideoPlayer](/plugins/videoplayer.md)
2930
<!-- - [Audio Player](/plugins/audioplayer.md) -->
3031
- [Image](/plugins/image.md)
31-
- [Keymap](/plugins/keymap.md)
3232
- [Pin](/plugins/pin.md)
3333
- [TV](/plugins/tv.md)
3434
- [Version Label](/plugins/versionlabel.md)

docs/plugins/app.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@
22

33
SDK provides various methods that can be used within the application.
44

5-
65
## Available Methods
76

8-
###overRideKeyMap
7+
### overRideKeyMap
8+
9+
This method can be used to merge and override the existing keymap (coming from `settings.json`) by using a custom keymap in runtime. The method will merge all key mappings by overriding the existing key mappings with the new ones when a key is defined in both keymaps.
10+
11+
`keepDuplicates` flag is set to `false` by default, which means duplicated values (like two keys listening to `Back`) will be removed from the final keymap. If `keepDuplicates` is set to `true`, duplicated **values** will be kept in the final keymap.
12+
13+
#### Usage
914

10-
Returns the new keymap by overriding the existing keymap with the new keymap based on the flag keepDefaults
15+
```js
16+
const customKeyMap = {
17+
13: "Enter",
18+
83: "Search"
19+
}
20+
21+
this.application.overRideKeyMap(customKeyMap) // keepDuplicates = false
22+
```
1123

12-
This can be done using the below snippet :
24+
or
1325

1426
```js
15-
this.application.overRideKeyMap(customKeyMap, keepDefaults)
27+
this.application.overRideKeyMap(customKeyMap, true) // keepDuplicates = true
1628
```
1729

18-
- `customKeyMap` : Keymap to be overidden
19-
- `keepDefaults`: Flag to overide the the default keymap or not.
20-
- By default `keepDefaults` will be false.
21-
- If set to `false`, it will override the existing keymap.
22-
- If set to `true`, it will be merged with the base keymap along with the exsiting keymap, where it has all the keys which has same values.
30+
#### Parameters
31+
32+
- `customKeyMap` : keymap object
33+
- `keepDuplicates`: flag to keep duplicated values in the final keymap or not. The default value is `false`.

0 commit comments

Comments
 (0)