fix(user-config): Layer switcher key behaviour on non-base layers (#440)
* refactor(user-config): Optimize imports * feat(user-config): Clone SwitchLayerAction to destination layer * fix(user-config): Fix Keymap SwitchLayerAction normalization * test(user-config): Remove spy callThrough * build: Add uhk-common test runner * build: delete test serialization files * fix(user-config): Add missing "type": "basic" properties to the user-config.json * test(user-config): Add KeyMacroAction tests * fix(user-config): Delete SwitchLayerAction from non destination layer * fix(user-config): Keymap normalize delete SwitchLayerActions from non base layers * ci: turn of uhk-web tests * ci: turn off karma watch mode in uhk-web test
This commit is contained in:
committed by
László Monda
parent
46b97a9b62
commit
7baf9ad009
164
packages/uhk-web/test/user-config-helper.ts
Normal file
164
packages/uhk-web/test/user-config-helper.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
const defaultUserConfig = {
|
||||
dataModelVersion: 4,
|
||||
moduleConfigurations: [
|
||||
{
|
||||
id: 1,
|
||||
initialPointerSpeed: 1,
|
||||
pointerAcceleration: 5,
|
||||
maxPointerSpeed: 200
|
||||
}
|
||||
],
|
||||
keymaps: [
|
||||
{
|
||||
isDefault: true,
|
||||
abbreviation: 'QWR',
|
||||
name: 'QWERTY',
|
||||
description: '',
|
||||
layers: [
|
||||
{
|
||||
modules: [
|
||||
{
|
||||
id: 0,
|
||||
pointerRole: 'move',
|
||||
keyActions: [
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 36
|
||||
},
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 37
|
||||
},
|
||||
{
|
||||
'keyActionType': 'switchLayer',
|
||||
'layer': 'mod',
|
||||
'toggle': false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
pointerRole: 'move',
|
||||
keyActions: [
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 53
|
||||
},
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 30
|
||||
},
|
||||
null
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
pointerRole: 'scroll',
|
||||
keyActions: []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
modules: [
|
||||
{
|
||||
id: 0,
|
||||
pointerRole: 'none',
|
||||
keyActions: [
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 64
|
||||
},
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 65
|
||||
},
|
||||
{
|
||||
keyActionType: 'switchLayer',
|
||||
layer: 'mod',
|
||||
toggle: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
pointerRole: 'none',
|
||||
keyActions: [
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 41
|
||||
},
|
||||
{
|
||||
keyActionType: 'keystroke',
|
||||
type: 'basic',
|
||||
scancode: 58
|
||||
},
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
modules: [
|
||||
{
|
||||
id: 0,
|
||||
pointerRole: 'move',
|
||||
keyActions: [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
pointerRole: 'scroll',
|
||||
keyActions: [
|
||||
null,
|
||||
{
|
||||
keyActionType: 'switchKeymap',
|
||||
keymapAbbreviation: 'DVO'
|
||||
},
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
modules: [
|
||||
{
|
||||
id: 0,
|
||||
pointerRole: 'move',
|
||||
keyActions: [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
pointerRole: 'move',
|
||||
keyActions: [
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
macros: []
|
||||
};
|
||||
|
||||
export function getDefaultUserConfig() {
|
||||
return cloneDeep(defaultUserConfig);
|
||||
}
|
||||
Reference in New Issue
Block a user