Skip to content

Instantly share code, notes, and snippets.

@AshleyGrant
Created September 5, 2017 14:08
Show Gist options
  • Save AshleyGrant/87b7807ef8a50301fe358b26f7263056 to your computer and use it in GitHub Desktop.
Save AshleyGrant/87b7807ef8a50301fe358b26f7263056 to your computer and use it in GitHub Desktop.
Aurelia Onscreen Keyboard Gist
<template>
<require from="./keyboard"></require>
<div>
<label>Name: </label>
<input type="text" value.bind="name" keyboard />
</div>
</template>
export class App {
name: 'Ashley';
}
<!doctype html>
<html>
<head>
<title>Aurelia</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css">
<link rel="stylesheet" href="https://mottie.github.io/Keyboard/css/keyboard.css">
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.mousewheel.js"></script>
<script src="https://mottie.github.io/Keyboard/js/jquery.keyboard.extension-typing.js"></script>
</head>
<body aurelia-app>
<h1>Loading...</h1>
<script src="https://jdanyow.github.io/rjs-bundle/node_modules/requirejs/require.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/config.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/aurelia.js"></script>
<script src="https://jdanyow.github.io/rjs-bundle/bundles/babel.js"></script>
<script>
require(['aurelia-bootstrapper']);
</script>
</body>
</html>
import {inject} from 'aurelia-framework';
@inject(Element)
export class KeyboardCustomAttribute {
constructor(el) {
this.el = el;
}
attached() {
$(this.el).keyboard({
layout: 'qwerty'
})
// activate the typing extension
.addTyping({
showTyping: true,
delay: 250
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment