Merge remote-tracking branch 'upstream/master' into feature/keymap_keymaps
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
node_modules
|
||||
typings
|
||||
.vscode
|
||||
bundle
|
||||
build
|
||||
|
||||
@@ -41,4 +41,8 @@ class KeystrokeModifiersAction extends KeyAction {
|
||||
toString(): string {
|
||||
return `<KeystrokeModifiersAction modifierMask="${this.modifierMask}">`;
|
||||
}
|
||||
|
||||
isModifierActive(modifier: KeyModifiers): boolean {
|
||||
return (this.modifierMask & modifier) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,8 @@ class KeystrokeWithModifiersAction extends KeyAction {
|
||||
toString(): string {
|
||||
return `<KeystrokeWithModifiersAction scancode="${this.scancode}" modifierMask="${this.modifierMask}">`;
|
||||
}
|
||||
|
||||
isModifierActive(modifier: KeyModifiers): boolean {
|
||||
return (this.modifierMask & modifier) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
enum KeyLayer {
|
||||
enum LayerName {
|
||||
mod,
|
||||
fn,
|
||||
mouse
|
||||
@@ -10,12 +10,12 @@ class SwitchLayerAction extends KeyAction {
|
||||
|
||||
isLayerToggleable: boolean;
|
||||
|
||||
// @assertEnum(KeyLayer)
|
||||
private layer: KeyLayer;
|
||||
// @assertEnum(LayerName)
|
||||
private layer: LayerName;
|
||||
|
||||
_fromJsObject(jsObject: any): SwitchLayerAction {
|
||||
this.assertKeyActionType(jsObject);
|
||||
this.layer = KeyLayer[<string> jsObject.layer];
|
||||
this.layer = LayerName[<string> jsObject.layer];
|
||||
this.isLayerToggleable = jsObject.toggle;
|
||||
return this;
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class SwitchLayerAction extends KeyAction {
|
||||
_toJsObject(): any {
|
||||
return {
|
||||
keyActionType: keyActionType.SwitchLayerAction,
|
||||
layer: KeyLayer[this.layer],
|
||||
layer: LayerName[this.layer],
|
||||
toggle: this.isLayerToggleable
|
||||
};
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
6
images/icons/kbd__fn--calculator.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M6 1h-5c-0.55 0-1 0.45-1 1v5c0 0.55 0.45 1 1 1h5c0.55 0 1-0.45 1-1v-5c0-0.55-0.45-1-1-1zM6 5h-5v-1h5v1zM14 1h-5c-0.55 0-1 0.45-1 1v13c0 0.55 0.45 1 1 1h5c0.55 0 1-0.45 1-1v-13c0-0.55-0.45-1-1-1zM14 10h-5v-1h5v1zM14 7h-5v-1h5v1zM6 9h-5c-0.55 0-1 0.45-1 1v5c0 0.55 0.45 1 1 1h5c0.55 0 1-0.45 1-1v-5c0-0.55-0.45-1-1-1zM6 13h-2v2h-1v-2h-2v-1h2v-2h1v2h2v1z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 704 B |
6
images/icons/kbd__fn--eject.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M0 12h16v2h-16zM8 2l8 8h-16z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 381 B |
75
images/icons/kbd__fn--screen-lock.svg
Executable file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 16 16"
|
||||
id="svg2"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="kbd__fn_screen-lock.svg">
|
||||
<metadata
|
||||
id="metadata10">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs8" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1144"
|
||||
id="namedview6"
|
||||
showgrid="false"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:object-nodes="true"
|
||||
inkscape:zoom="57.8125"
|
||||
inkscape:cx="8"
|
||||
inkscape:cy="8"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<g
|
||||
id="g4163">
|
||||
<path
|
||||
d="M 15,10 1,10 1,2 15,2 15,10 Z M 0,1 0,11 16,11 16,1 0,1 Z"
|
||||
id="path4154" />
|
||||
<path
|
||||
id="path4"
|
||||
d="m 10.5,12 -5,0 -0.5,2 -1,1 8,0 -1,-1 z" />
|
||||
<path
|
||||
style="fill:#000000"
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 9.3599992,5.5200004 -0.08,0 0,-0.959999 c 0,-0.5292796 -0.43072,-0.959999 -0.959999,-0.959999 l -0.6399996,0 c -0.5292795,0 -0.9599991,0.4307195 -0.9599991,0.959999 l 0,0.959999 -0.08,0 c -0.1318398,0 -0.2399997,0.1081599 -0.2399997,0.2399997 l 0,2.3999978 c 0,0.1318395 0.1081599,0.2399997 0.2399997,0.2399997 l 2.7199977,0 c 0.131839,0 0.239999,-0.1081601 0.239999,-0.2399997 l 0,-2.3999978 c 0,-0.1318398 -0.10816,-0.2399998 -0.239999,-0.2399998 z M 7.3600008,4.5600014 c 0,-0.1763198 0.1436798,-0.3199998 0.3199997,-0.3199998 l 0.6399997,0 c 0.176319,0 0.319999,0.14368 0.319999,0.3199998 l 0,0.959999 -1.2799984,0 0,-0.959999 z"
|
||||
id="path4140" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
6
images/icons/kbd__media--mute.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M11 0l-5 5h-3v6l8-8zM14.909 1.091l-13.818 13.818 1.091 1.091 4.409-4.409 4.409 4.409v-8.818l5-5z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 449 B |
6
images/icons/kbd__media--next.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M12 2v12h-2v-5.5l-5 5v-11l5 5v-5.5z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 388 B |
6
images/icons/kbd__media--pause.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M2 2h5v12h-5zM9 2h5v12h-5z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 379 B |
6
images/icons/kbd__media--play.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M3 2l10 6-10 6z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 368 B |
6
images/icons/kbd__media--prev.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M4 14v-12h2v5.5l5-5v11l-5-5v5.5z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 385 B |
7
images/icons/kbd__media--vol-up.svg
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="17" height="16" viewBox="0 0 17 16">
|
||||
<path fill="#000000" d="M13.907 14.407c-0.192 0-0.384-0.073-0.53-0.22-0.293-0.293-0.293-0.768 0-1.061 1.369-1.369 2.123-3.19 2.123-5.127s-0.754-3.757-2.123-5.127c-0.293-0.293-0.293-0.768 0-1.061s0.768-0.293 1.061 0c1.653 1.653 2.563 3.85 2.563 6.187s-0.91 4.534-2.563 6.187c-0.146 0.146-0.338 0.22-0.53 0.22zM11.243 12.993c-0.192 0-0.384-0.073-0.53-0.22-0.293-0.293-0.293-0.768 0-1.061 2.047-2.047 2.047-5.378 0-7.425-0.293-0.293-0.293-0.768 0-1.061s0.768-0.293 1.061 0c1.275 1.275 1.977 2.97 1.977 4.773s-0.702 3.498-1.977 4.773c-0.146 0.146-0.338 0.22-0.53 0.22v0zM8.578 11.578c-0.192 0-0.384-0.073-0.53-0.22-0.293-0.293-0.293-0.768 0-1.061 1.267-1.267 1.267-3.329 0-4.596-0.293-0.293-0.293-0.768 0-1.061s0.768-0.293 1.061 0c1.852 1.852 1.852 4.865 0 6.718-0.146 0.146-0.338 0.22-0.53 0.22z"></path>
|
||||
<path fill="#000000" d="M6.5 15c-0.13 0-0.258-0.051-0.354-0.146l-3.854-3.854h-1.793c-0.276 0-0.5-0.224-0.5-0.5v-5c0-0.276 0.224-0.5 0.5-0.5h1.793l3.854-3.854c0.143-0.143 0.358-0.186 0.545-0.108s0.309 0.26 0.309 0.462v13c0 0.202-0.122 0.385-0.309 0.462-0.062 0.026-0.127 0.038-0.191 0.038z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
6
images/icons/kbd__media.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M15 0h1v11.5c0 1.381-1.567 2.5-3.5 2.5s-3.5-1.119-3.5-2.5c0-1.381 1.567-2.5 3.5-2.5 0.979 0 1.865 0.287 2.5 0.751v-5.751l-8 1.778v7.722c0 1.381-1.567 2.5-3.5 2.5s-3.5-1.119-3.5-2.5c0-1.381 1.567-2.5 3.5-2.5 0.979 0 1.865 0.287 2.5 0.751v-9.751l9-2z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 601 B |
6
images/icons/kbd__mouse.svg
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M12.43 9.942l-2.4-4c-1.11-1.851-3.481-2.479-5.356-1.447-0.404-0.726-0.674-1.413-0.674-1.995 0-0.546 0.118-1.255 0.683-1.526 0.043-0.021 0.107-0.052 0.171-0.115 0.195-0.195 0.195-0.512 0-0.707-0.165-0.165-0.415-0.19-0.607-0.078-0.804 0.388-1.247 1.249-1.247 2.426 0 0.812 0.345 1.688 0.858 2.587-1.342 1.261-1.674 3.327-0.688 4.971l2.4 4c0.75 1.25 2.075 1.943 3.434 1.943 0.7 0 1.41-0.184 2.054-0.571 1.894-1.137 2.509-3.594 1.372-5.488zM7.377 9.307c-0.143 0.091-0.303 0.134-0.461 0.134-0.284 0-0.562-0.141-0.726-0.398l-1.149-1.806c-0.255-0.4-0.137-0.932 0.264-1.186s0.932-0.137 1.186 0.264l1.149 1.806c0.255 0.4 0.137 0.932-0.264 1.186z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 989 B |
7
images/icons/kdb__media--vol-down.svg
Executable file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generated by IcoMoon.io -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="#000000" d="M8.578 11.578c-0.192 0-0.384-0.073-0.53-0.22-0.293-0.293-0.293-0.768 0-1.061 1.267-1.267 1.267-3.329 0-4.596-0.293-0.293-0.293-0.768 0-1.061s0.768-0.293 1.061 0c1.852 1.852 1.852 4.865 0 6.718-0.146 0.146-0.338 0.22-0.53 0.22z"></path>
|
||||
<path fill="#000000" d="M6.5 15c-0.13 0-0.258-0.051-0.354-0.146l-3.854-3.854h-1.793c-0.276 0-0.5-0.224-0.5-0.5v-5c0-0.276 0.224-0.5 0.5-0.5h1.793l3.854-3.854c0.143-0.143 0.358-0.186 0.545-0.108s0.309 0.26 0.309 0.462v13c0 0.202-0.122 0.385-0.309 0.462-0.062 0.026-0.127 0.038-0.191 0.038z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 877 B |
@@ -166,7 +166,7 @@
|
||||
<script src="node_modules/handlebars/dist/handlebars.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<script src="macro.js"></script>
|
||||
<script src="bundle/uhk.js"></script>
|
||||
<script src="build/uhk.js"></script>
|
||||
|
||||
<script type="text/x-handlebars-template" id="sidebar-menu--source">
|
||||
{{#if menu}}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
"typings": "^0.7.12",
|
||||
"webpack": "^1.13.0",
|
||||
"webpack-dev-server": "^1.14.1",
|
||||
"webpack-svgstore-plugin": "^2.1.5",
|
||||
"xml-loader": "^1.1.0",
|
||||
"yargs": "^4.2.0",
|
||||
"zone.js": "^0.6.11"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// var webpack = require("webpack");
|
||||
var SvgStore = require('webpack-svgstore-plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: ['reflect-metadata', 'zone.js', 'es6-shim', "./src/boot.ts"],
|
||||
output: {
|
||||
path: __dirname + "/bundle",
|
||||
path: __dirname + "/build",
|
||||
filename: "uhk.js"
|
||||
},
|
||||
devtool: 'source-map',
|
||||
@@ -21,9 +22,24 @@ module.exports = {
|
||||
loaders: [
|
||||
{ test: /\.ts$/, loader: 'ts-loader', exclude: /node_modules/ }
|
||||
]
|
||||
}/*,
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin({ minimize: true })
|
||||
]*/
|
||||
// new webpack.optimize.UglifyJsPlugin({ minimize: true })
|
||||
new SvgStore(
|
||||
[
|
||||
'images/icons/**/*.svg'
|
||||
],
|
||||
'./',
|
||||
{
|
||||
name: 'compiled_sprite.svg',
|
||||
chunk: 'app',
|
||||
svgoOptions: {
|
||||
plugins: [
|
||||
{ removeTitle: true }
|
||||
]
|
||||
}
|
||||
}
|
||||
)
|
||||
]
|
||||
|
||||
}
|
||||