Skip to content

Commit 986a816

Browse files
committed
changed variable names with correct format
1 parent a427830 commit 986a816

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

docs/plugins/app.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ SDK provides various methods that can be used within the application.
44

55
## Available Methods
66

7-
### overRideKeyMap
7+
### overrideKeyMap
88

99
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.
1010

@@ -18,13 +18,13 @@ const customKeyMap = {
1818
83: "Search"
1919
}
2020

21-
this.application.overRideKeyMap(customKeyMap) // keepDuplicates = false
21+
this.application.overrideKeyMap(customKeyMap) // keepDuplicates = false
2222
```
2323

2424
or
2525

2626
```js
27-
this.application.overRideKeyMap(customKeyMap, true) // keepDuplicates = true
27+
this.application.overrideKeyMap(customKeyMap, true) // keepDuplicates = true
2828
```
2929

3030
#### Parameters

src/Application/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,24 +125,24 @@ export default function(App, appData, platformSettings) {
125125

126126
/**
127127
* This function overrides the default keymap with the latest keymap.
128-
* @param customKeymap
128+
* @param customKeyMap
129129
* @param keepDuplicates
130130
*/
131-
overrideKeyMap(customKeymap, keepDuplicates = false) {
132-
const baseKeymap = this.stage.application.config.keys
133-
Object.keys(customKeymap).reduce((keymapping, key) => {
131+
overrideKeyMap(customKeyMap, keepDuplicates = false) {
132+
const baseKeyMap = this.stage.application.config.keys
133+
Object.keys(customKeyMap).reduce((keymapping, key) => {
134134
// prevent duplicate values to exist in final keymapping (i.e. 2 keys triggering 'Back')
135135
if (!keepDuplicates) {
136-
Object.keys(baseKeymap).forEach(baseKey => {
137-
if (baseKey != key && baseKeymap[baseKey] == customKeymap[key]) {
136+
Object.keys(baseKeyMap).forEach(baseKey => {
137+
if (baseKey != key && baseKeyMap[baseKey] == customKeyMap[key]) {
138138
delete keymapping[baseKey]
139139
}
140140
})
141141
}
142-
keymapping[key] = customKeymap[key]
142+
keymapping[key] = customKeyMap[key]
143143
return keymapping
144-
}, baseKeymap)
145-
return baseKeymap
144+
}, baseKeyMap)
145+
return baseKeyMap
146146
}
147147

148148
_setup() {

0 commit comments

Comments
 (0)