* add @angular/cli to the project * increase nodejs version -> 8.2.1 * add lerna * merge web and shared module * move electron module into packages as uhk-agent Electron agent functionality is not working * delete symlinker * convert private properties to public of component if used in html * revert uhk-message.component * fix component path * fix the correct name of the uhk-message.component.scss * building web and electron module * delete uhk-renderer package * handle device connect disconnect state * add privilege detection * fix set privilege functionality * turn back download keymap functionality * add bootstrap, select2 js and fix null pointer exception * turn back upload data to keyboard * fix send keymap * fix test-serializer * add missing package.json * merging * fix appveyor build * fix linting * turn back electron storage service * commit the missing electron-datastorage-repository * update node to 8.3.0 in .nvmrc and log node version in appveyor build * set exact version number in appveyor build * vertical align privilege and missing device components * set back node version to 8 in appveyor * move node-usb dependency from usb dir to root maybe it is fix the appveyor build * revert usb to root * fix electron builder script * fix electron builder script * turn off electron devtools * remove CTRL+U functionality * fix CTRL+o * fix lint error * turnoff store freeze * start process when got `Error: EPERM: operation not permitted` error * move files from root usb dir -> packages/usb
103 lines
3.0 KiB
TypeScript
103 lines
3.0 KiB
TypeScript
import { Action } from '@ngrx/store';
|
|
|
|
import { KeyAction } from '../../config-serializer/config-items/key-action';
|
|
import { Keymap } from '../../config-serializer/config-items/keymap';
|
|
import { Macro } from '../../config-serializer/config-items/macro';
|
|
|
|
export namespace KeymapActions {
|
|
export const PREFIX = '[Keymap] ';
|
|
export const ADD = KeymapActions.PREFIX + 'Add keymap';
|
|
export const DUPLICATE = KeymapActions.PREFIX + 'Duplicate keymap';
|
|
export const EDIT_ABBR = KeymapActions.PREFIX + 'Edit keymap abbreviation';
|
|
export const EDIT_NAME = KeymapActions.PREFIX + 'Edit keymap title';
|
|
export const SAVE_KEY = KeymapActions.PREFIX + 'Save key action';
|
|
export const SET_DEFAULT = KeymapActions.PREFIX + 'Set default option';
|
|
export const REMOVE = KeymapActions.PREFIX + 'Remove keymap';
|
|
export const CHECK_MACRO = KeymapActions.PREFIX + 'Check deleted macro';
|
|
export const LOAD_KEYMAPS = KeymapActions.PREFIX + 'Load keymaps';
|
|
export const LOAD_KEYMAPS_SUCCESS = KeymapActions.PREFIX + 'Load keymaps success';
|
|
export const UNDO_LAST_ACTION = KeymapActions.PREFIX + 'Undo last action';
|
|
|
|
export function loadKeymaps(): Action {
|
|
return {
|
|
type: KeymapActions.LOAD_KEYMAPS
|
|
};
|
|
}
|
|
|
|
export function loadKeymapsSuccess(keymaps: Keymap[]): Action {
|
|
return {
|
|
type: KeymapActions.LOAD_KEYMAPS_SUCCESS,
|
|
payload: keymaps
|
|
};
|
|
}
|
|
|
|
export function addKeymap(item: Keymap): Action {
|
|
return {
|
|
type: KeymapActions.ADD,
|
|
payload: item
|
|
};
|
|
}
|
|
|
|
export function setDefault(abbr: string): Action {
|
|
return {
|
|
type: KeymapActions.SET_DEFAULT,
|
|
payload: abbr
|
|
};
|
|
}
|
|
|
|
export function removeKeymap(abbr: string): Action {
|
|
return {
|
|
type: KeymapActions.REMOVE,
|
|
payload: abbr
|
|
};
|
|
}
|
|
|
|
export function duplicateKeymap(keymap: Keymap): Action {
|
|
return {
|
|
type: KeymapActions.DUPLICATE,
|
|
payload: keymap
|
|
};
|
|
}
|
|
|
|
export function editKeymapName(abbr: string, name: string): Action {
|
|
return {
|
|
type: KeymapActions.EDIT_NAME,
|
|
payload: {
|
|
abbr: abbr,
|
|
name: name
|
|
}
|
|
};
|
|
}
|
|
|
|
export function editKeymapAbbr(name: string, abbr: string, newAbbr: string): Action {
|
|
return {
|
|
type: KeymapActions.EDIT_ABBR,
|
|
payload: {
|
|
name,
|
|
abbr,
|
|
newAbbr
|
|
}
|
|
};
|
|
}
|
|
|
|
export function saveKey(keymap: Keymap, layer: number, module: number, key: number, keyAction: KeyAction): Action {
|
|
return {
|
|
type: KeymapActions.SAVE_KEY,
|
|
payload: {
|
|
keymap,
|
|
layer,
|
|
module,
|
|
key,
|
|
keyAction
|
|
}
|
|
};
|
|
}
|
|
|
|
export function checkMacro(macro: Macro): Action {
|
|
return {
|
|
type: KeymapActions.CHECK_MACRO,
|
|
payload: macro
|
|
};
|
|
}
|
|
}
|