Files
DefinitelyTyped/types/virtual-keyboard/virtual-keyboard-tests.ts
Bogdan 04fc36fa2e new definition for "virtual-keyboard" (#18441)
* New definition for 'react-virtual-keyboard'

* fixes

* cleaning

* delete comments and blank line

* "noImplicitThis" have to be equal "true"

* new definition for 'virtual-keyboard'

* change files list in tsconfig.json

* Expected file 'virtual-keyboard-test.ts' to be named virtual-keyboard-tests.ts

* fix errors

* errors

* delete header

* Expected '// Type definitions for '

* header

* Error: At 3:60 : Expected one of

* header

* header

* header

* errors

* err

* err

* error

* global JQuery

* trailing whitespace
2017-07-28 07:00:57 -07:00

74 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as jQuery from "jquery";
import { KeyboardOptions, NavigateOptions } from "virtual-keyboard";
const kbOptions: KeyboardOptions = {
display: {
bksp : "\u2190",
accept: `Next` ,
cancel: `Back`,
normal: "ABC",
meta1 : "#+-",
space : "Space",
alt : `Alt`,
s : `ABC`,
},
acceptValid: true,
type: "input",
layout: "custom",
customLayout: {
normal: [
`a b c d e f g h i j k l m`,
`n o p q r s t u v x y z w`,
`1 2 3 4 5 6 7 8 9 0 . _ @`,
`{alt} {s} {space} {meta1} {s} {bksp} `,
`{cancel} {accept}`
],
shift: [
`A B C D E F G H I J K L M`,
`N O P Q R S T U V X Y Z W`,
`1 2 3 4 5 6 7 8 9 0 . _ @`,
`{alt} {s} {space} {meta1} {s} {bksp} `,
`{cancel} {accept}`
],
meta1: [
`- / : ; ( ) \u20ac & \" ! ? ' \``,
`[ ] { } # % ^ * + = ° ´ §`,
` \\ | ~ < > $ \u00a3 \u00a5 , ' ² ³`,
`{space} {meta1} {bksp}`,
`{cancel} {accept}`
],
"alt-shift": [
`A B C D E F G H I J K L M N O`,
`P Q R S T U V X Y Z W \u00df \u00dc \u00d6 \u00c4`,
`1 2 3 4 5 6 7 8 9 0 . _ @ \u0301`,
`{alt} {s} {space} {meta1} {s} {bksp} `,
`{cancel} {accept}`
],
alt: [
`a b c d e f g h i j k l m n o`,
`p q r s t u v x y z w \u00df \u00fc \u00f6 \u00e4`,
`1 2 3 4 5 6 7 8 9 0 . _ @ \u0301`,
`{alt} {s} {space} {meta1} {s} {bksp} `,
`{cancel} {accept}`
],
},
lockInput: true,
alwaysOpen: true,
appendLocally: true,
color: "light",
class: "sxcycx",
updateOnChange: true,
usePreview: false,
tabNavigation: false,
canceled: () => { console.log("cancelled"); }
};
const navOptions: NavigateOptions = {
position : [0, 0],
toggleMode : true,
focusClass : "hasFocus",
rowLooping : true,
};
jQuery("#keyboard").keyboard(kbOptions).addNavigation(navOptions);