Merge branch 'master' of github.com:UltimateHackingKeyboard/agent
This commit is contained in:
20
package-lock.json
generated
20
package-lock.json
generated
@@ -6009,20 +6009,20 @@
|
||||
}
|
||||
},
|
||||
"electron-rebuild": {
|
||||
"version": "1.8.5",
|
||||
"resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.5.tgz",
|
||||
"integrity": "sha512-gDwRA3utfiPnFwBZ1z8M4SEMwsdsy6Bg4VGO2ohelMOIO0vxiCrDQ/FVdLk3h2g7fLb06QFUsQU+86jiTSmZxw==",
|
||||
"version": "1.8.6",
|
||||
"resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.6.tgz",
|
||||
"integrity": "sha512-4BAPcNG0XP6stByqvFXggrjmf/C47P2L6HFFrWdR2ako1VLiTDIeZAOmU4WEBuWdaXYNqstleszVmcNHdRDojA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "^1.3.3",
|
||||
"debug": "^4.1.1",
|
||||
"detect-libc": "^1.0.3",
|
||||
"fs-extra": "^7.0.1",
|
||||
"node-abi": "^2.8.0",
|
||||
"node-gyp": "^4.0.0",
|
||||
"node-abi": "^2.9.0",
|
||||
"node-gyp": "^5.0.1",
|
||||
"ora": "^3.4.0",
|
||||
"spawn-rx": "^3.0.0",
|
||||
"yargs": "^13.2.2"
|
||||
"yargs": "^13.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
@@ -10907,17 +10907,17 @@
|
||||
}
|
||||
},
|
||||
"node-gyp": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-4.0.0.tgz",
|
||||
"integrity": "sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-5.0.3.tgz",
|
||||
"integrity": "sha512-z/JdtkFGUm0QaQUusvloyYuGDub3nUbOo5de1Fz57cM++osBTvQatBUSTlF1k/w8vFHPxxXW6zxGvkxXSpaBkQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"env-paths": "^1.0.0",
|
||||
"glob": "^7.0.3",
|
||||
"graceful-fs": "^4.1.2",
|
||||
"mkdirp": "^0.5.0",
|
||||
"nopt": "2 || 3",
|
||||
"npmlog": "0 || 1 || 2 || 3 || 4",
|
||||
"osenv": "0",
|
||||
"request": "^2.87.0",
|
||||
"rimraf": "2",
|
||||
"semver": "~5.3.0",
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"buffer": "5.0.6",
|
||||
"check-node-version": "^3.2.0",
|
||||
"copy-webpack-plugin": "5.0.0",
|
||||
"copyfiles": "^2.0.0",
|
||||
"copyfiles": "2.1.1",
|
||||
"core-js": "2.4.1",
|
||||
"cross-env": "5.0.5",
|
||||
"decompress": "4.2.0",
|
||||
@@ -49,7 +49,7 @@
|
||||
"electron-debug": "1.5.0",
|
||||
"electron-devtools-installer": "2.2.3",
|
||||
"electron-log": "2.2.16",
|
||||
"electron-rebuild": "1.8.5",
|
||||
"electron-rebuild": "1.8.6",
|
||||
"electron-settings": "3.1.4",
|
||||
"electron-updater": "2.21.4",
|
||||
"exports-loader": "0.6.3",
|
||||
|
||||
@@ -15,7 +15,12 @@ export enum MouseActionParam {
|
||||
scrollLeft,
|
||||
scrollRight,
|
||||
accelerate,
|
||||
decelerate
|
||||
decelerate,
|
||||
button4,
|
||||
button5,
|
||||
button6,
|
||||
button7,
|
||||
button8
|
||||
}
|
||||
|
||||
export class MouseAction extends KeyAction {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { HardwareModuleInfo } from './hardware-module-info';
|
||||
import { LeftModuleInfo } from './left-module-info';
|
||||
import { RightModuleInfo } from './right-module-info';
|
||||
|
||||
export interface HardwareModules {
|
||||
leftModuleInfo?: HardwareModuleInfo;
|
||||
rightModuleInfo?: HardwareModuleInfo;
|
||||
leftModuleInfo?: LeftModuleInfo;
|
||||
rightModuleInfo?: RightModuleInfo;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ export * from './app-start-info';
|
||||
export * from './configuration-reply';
|
||||
export * from './version-information';
|
||||
export * from './device-connection-state';
|
||||
export * from './left-module-info';
|
||||
export * from './hardware-modules';
|
||||
export * from './hardware-module-info';
|
||||
export * from './right-module-info';
|
||||
export * from './save-user-configuration-data';
|
||||
export * from './udev-rules-info';
|
||||
export * from './update-firmware-data';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface HardwareModuleInfo {
|
||||
export interface LeftModuleInfo {
|
||||
firmwareVersion?: string;
|
||||
moduleProtocolVersion?: string;
|
||||
}
|
||||
7
packages/uhk-common/src/models/right-module-info.ts
Normal file
7
packages/uhk-common/src/models/right-module-info.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface RightModuleInfo {
|
||||
deviceProtocolVersion?: string;
|
||||
hardwareConfigVersion?: string;
|
||||
firmwareVersion?: string;
|
||||
moduleProtocolVersion?: string;
|
||||
userConfigVersion?: string;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HardwareModuleInfo, LogService, UhkBuffer } from 'uhk-common';
|
||||
import { LeftModuleInfo, LogService, RightModuleInfo, UhkBuffer } from 'uhk-common';
|
||||
import { DataOption, KBoot, Properties, UsbPeripheral } from 'kboot';
|
||||
|
||||
import {
|
||||
@@ -248,7 +248,7 @@ export class UhkOperations {
|
||||
return false;
|
||||
}
|
||||
|
||||
public async getLeftModuleVersionInfo(): Promise<HardwareModuleInfo> {
|
||||
public async getLeftModuleVersionInfo(): Promise<LeftModuleInfo> {
|
||||
try {
|
||||
this.logService.debug('[DeviceOperation] USB[T]: Read left module version information');
|
||||
|
||||
@@ -277,7 +277,7 @@ export class UhkOperations {
|
||||
};
|
||||
}
|
||||
|
||||
public async getRightModuleVersionInfo(): Promise<HardwareModuleInfo> {
|
||||
public async getRightModuleVersionInfo(): Promise<RightModuleInfo> {
|
||||
this.logService.debug('[DeviceOperation] USB[T]: Read right module version information');
|
||||
|
||||
const command = Buffer.from([UsbCommand.GetProperty, DevicePropertyIds.ProtocolVersions]);
|
||||
@@ -287,7 +287,11 @@ export class UhkOperations {
|
||||
uhkBuffer.readUInt8();
|
||||
|
||||
return {
|
||||
firmwareVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`
|
||||
firmwareVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`,
|
||||
deviceProtocolVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`,
|
||||
moduleProtocolVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`,
|
||||
userConfigVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`,
|
||||
hardwareConfigVersion: `${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}.${uhkBuffer.readUInt16()}`
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
5543
packages/uhk-web/package-lock.json
generated
5543
packages/uhk-web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -19,21 +19,21 @@
|
||||
},
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@angular/animations": "8.2.2",
|
||||
"@angular/animations": "8.2.3",
|
||||
"@angular-builders/custom-webpack": "8.1.0",
|
||||
"@angular/cli": "8.2.1",
|
||||
"@angular/common": "8.2.2",
|
||||
"@angular/compiler": "8.2.2",
|
||||
"@angular/compiler-cli": "8.2.2",
|
||||
"@angular/core": "8.2.2",
|
||||
"@angular/common": "8.2.3",
|
||||
"@angular/compiler": "8.2.3",
|
||||
"@angular/compiler-cli": "8.2.3",
|
||||
"@angular/core": "8.2.3",
|
||||
"@angular-devkit/build-angular": "0.802.1",
|
||||
"@angular-devkit/build-optimizer": "0.802.1",
|
||||
"@angular-devkit/core": "8.2.1",
|
||||
"@angular/forms": "8.2.2",
|
||||
"@angular/language-service": "8.2.2",
|
||||
"@angular/platform-browser": "8.2.2",
|
||||
"@angular/platform-browser-dynamic": "8.2.2",
|
||||
"@angular/router": "8.2.2",
|
||||
"@angular/forms": "8.2.3",
|
||||
"@angular/language-service": "8.2.3",
|
||||
"@angular/platform-browser": "8.2.3",
|
||||
"@angular/platform-browser-dynamic": "8.2.3",
|
||||
"@angular/router": "8.2.3",
|
||||
"@ngtools/webpack": "8.2.1",
|
||||
"@ngrx/effects": "8.2.0",
|
||||
"@ngrx/router-store": "8.2.0",
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
></layer-tab>
|
||||
<mouse-tab #tab *ngSwitchCase="tabName.Mouse" class="popover-content"
|
||||
[defaultKeyAction]="defaultKeyAction"
|
||||
[extraMouseButtonsSupported]="extraMouseButtonsSupported$ | async"
|
||||
(validAction)="setKeyActionValidState($event)"
|
||||
></mouse-tab>
|
||||
<macro-tab #tab *ngSwitchCase="tabName.Macro" class="popover-content"
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
|
||||
import { Tab } from './tab';
|
||||
|
||||
import { AppState, getKeymaps, macroPlaybackSupported } from '../../store';
|
||||
import { AppState, extraMouseButtonsSupported, getKeymaps, macroPlaybackSupported } from '../../store';
|
||||
import { KeyActionRemap } from '../../models/key-action-remap';
|
||||
import { RemapInfo } from '../../models/remap-info';
|
||||
|
||||
@@ -145,6 +145,7 @@ export class PopoverComponent implements OnChanges {
|
||||
}
|
||||
];
|
||||
macroPlaybackSupported$: Observable<boolean>;
|
||||
extraMouseButtonsSupported$: Observable<boolean>;
|
||||
|
||||
private readonly currentKeymap$ = new BehaviorSubject<Keymap>(undefined);
|
||||
|
||||
@@ -158,6 +159,7 @@ export class PopoverComponent implements OnChanges {
|
||||
keymaps.filter((keymap: Keymap) => currentKeymap.abbreviation !== keymap.abbreviation))
|
||||
);
|
||||
this.macroPlaybackSupported$ = store.select(macroPlaybackSupported);
|
||||
this.extraMouseButtonsSupported$ = store.select(extraMouseButtonsSupported);
|
||||
}
|
||||
|
||||
ngOnChanges(change: SimpleChanges) {
|
||||
|
||||
@@ -80,6 +80,27 @@
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.rightClick"
|
||||
(click)="setMouseActionParam(MouseActionParam.rightClick)">Right</button>
|
||||
</div>
|
||||
<div class="additional-keys" *ngIf="extraMouseButtonsSupported">
|
||||
<div class="btn-group col-xs-12" role="group">
|
||||
<button type="button" class="btn btn-default col-xs-4"
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.button4"
|
||||
(click)="setMouseActionParam(MouseActionParam.button4)">Button 4</button>
|
||||
<button type="button" class="btn btn-default col-xs-4"
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.button5"
|
||||
(click)="setMouseActionParam(MouseActionParam.button5)">Button 5</button>
|
||||
<button type="button" class="btn btn-default col-xs-4"
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.button6"
|
||||
(click)="setMouseActionParam(MouseActionParam.button6)">Button 6</button>
|
||||
</div>
|
||||
<div class="btn-group col-xs-12" role="group">
|
||||
<button type="button" class="btn btn-default col-xs-6"
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.button7"
|
||||
(click)="setMouseActionParam(MouseActionParam.button7)">Button 7</button>
|
||||
<button type="button" class="btn btn-default col-xs-6"
|
||||
[class.btn-primary]="mouseActionParam === MouseActionParam.button8"
|
||||
(click)="setMouseActionParam(MouseActionParam.button8)">Button 8</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngSwitchCase="3" class="mouse__config mouse__config--speed text-center">
|
||||
<div class="help-text--mouse-speed text-left">
|
||||
@@ -104,4 +125,4 @@
|
||||
</div>
|
||||
<div *ngSwitchDefault>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,6 +54,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
.mouse__config--click {
|
||||
.additional-keys {
|
||||
display: inline-block;
|
||||
margin-top: 1rem;
|
||||
|
||||
.btn-group:first-child {
|
||||
.btn {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-group:last-child {
|
||||
.btn {
|
||||
border-top: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
|
||||
&:last-child {
|
||||
right: 1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mouse__config--speed {
|
||||
.btn-default {
|
||||
font-size: 25px;
|
||||
|
||||
@@ -11,6 +11,7 @@ import { Tab } from '../tab';
|
||||
})
|
||||
export class MouseTabComponent extends Tab implements OnChanges {
|
||||
@Input() defaultKeyAction: KeyAction;
|
||||
@Input() extraMouseButtonsSupported: boolean;
|
||||
|
||||
/* tslint:disable:variable-name: It is an enum type. So it can start with uppercase. */
|
||||
MouseActionParam = MouseActionParam;
|
||||
@@ -62,6 +63,11 @@ export class MouseTabComponent extends Tab implements OnChanges {
|
||||
case MouseActionParam.leftClick:
|
||||
case MouseActionParam.middleClick:
|
||||
case MouseActionParam.rightClick:
|
||||
case MouseActionParam.button4:
|
||||
case MouseActionParam.button5:
|
||||
case MouseActionParam.button6:
|
||||
case MouseActionParam.button7:
|
||||
case MouseActionParam.button8:
|
||||
this.selectedPageIndex = 2;
|
||||
break;
|
||||
case MouseActionParam.decelerate:
|
||||
|
||||
@@ -28,6 +28,26 @@ export class SvgMouseKeyComponent implements OnChanges {
|
||||
this.type = 'click';
|
||||
this.param = 'Middle';
|
||||
break;
|
||||
case MouseActionParam.button4:
|
||||
this.type = 'click';
|
||||
this.param = 'Button 4';
|
||||
break;
|
||||
case MouseActionParam.button5:
|
||||
this.type = 'click';
|
||||
this.param = 'Button 5';
|
||||
break;
|
||||
case MouseActionParam.button6:
|
||||
this.type = 'click';
|
||||
this.param = 'Button 6';
|
||||
break;
|
||||
case MouseActionParam.button7:
|
||||
this.type = 'click';
|
||||
this.param = 'Button 7';
|
||||
break;
|
||||
case MouseActionParam.button8:
|
||||
this.type = 'click';
|
||||
this.param = 'Button 8';
|
||||
break;
|
||||
case MouseActionParam.scrollDown:
|
||||
this.type = 'scroll';
|
||||
this.param = 'down';
|
||||
|
||||
@@ -157,3 +157,6 @@ export const layerDoubleTapSupported = createSelector(
|
||||
return isVersionGte(hardwareModules.rightModuleInfo.firmwareVersion, '8.4.3');
|
||||
}
|
||||
);
|
||||
export const extraMouseButtonsSupported = createSelector(getHardwareModules, (hardwareModules: HardwareModules): boolean => {
|
||||
return isVersionGte(hardwareModules.rightModuleInfo.userConfigVersion, '4.1.1');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user