Skip to content

Commit 52c78b4

Browse files
committed
Merged develop into master
2 parents 651ae3c + 02aa7e0 commit 52c78b4

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# angular-material-keyboard
2-
Onscreen virtual keyboard for Angular (https://angularjs.org/) using Material (https://material.angularjs.org/) and the Angular Virtual Keyboard by the-darc (https://github.com/the-darc/angular-virtual-keyboard) based on GreyWyvern VKI (http://www.greywyvern.com/code/javascript/keyboard).
2+
Onscreen virtual keyboard for [Angular](https://angularjs.org/) using [Angular Material](https://material.angularjs.org/) and the [Angular Virtual Keyboard by the-darc](https://github.com/the-darc/angular-virtual-keyboard) based on [GreyWyvern VKI](http://www.greywyvern.com/code/javascript/keyboard).
3+
4+
## demo
5+
Checkout the [demo.html](https://cdn.rawgit.com/davidenke/angular-material-keyboard/master/demo.html)
36

47
## usage
58
* download or clone the latest release, or use your preferred packet manager
69
* add the javascript and css files to your project:
710
```html
811
<script src="angular-material-keyboard/dist/mdKeyboard.min.js"></script>
912
<link rel="stylesheet" href="angular-material-keyboard/dist/mdKeyboard.css">
13+
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Material+Icons">
1014
```
1115
* register module:
1216
```javascript
@@ -43,27 +47,31 @@ angular
4347
// add layout for number fields
4448
$mdKeyboardProvider.addLayout('Numbers', {
4549
'name': 'Numbers', 'keys': [
46-
[['1', '1'], ['2', '2'], ['3', '3']],
47-
[['4', '4'], ['5', '5'], ['6', '6']],
48-
[['7', '7'], ['8', '8'], ['9', '9']],
49-
[['Bksp', 'Bksp'], ['0', '0'], ['Enter', 'Enter']]
50+
[['7', '7'], ['8', '8'], ['9', '9'], ['Bksp', 'Bksp']],
51+
[['4', '4'], ['5', '5'], ['6', '6'], ['-', '-']],
52+
[['1', '1'], ['2', '2'], ['3', '3'], ['+', '+']],
53+
[['0', '0'], ['Spacer'], [','], ['Enter', 'Enter']]
5054
], 'lang': ['de']
5155
});
5256

5357
// default layout is german
54-
$mdKeyboardProvider.useLayout('Deutsch');
58+
$mdKeyboardProvider.defaultLayout('Deutsch');
5559
});
5660
```
5761
The first entry in each 'key' array is the default char. The second is used when pressing 'shift' or 'caps lock', the third when 'alt' is rpessed.
5862
You can use the `spacer` key to provide a gap in the layout.
5963

6064
The `$mdKeyboardProvider` has the following methods:
6165

62-
`getLayout():string` will give you the current used layout
66+
`getLayout(layout:string):object` will give you the corresponding layout
67+
68+
`getCurrentLayout():string` will give you the current used layout
6369

6470
`getLayouts():array` returns all registered layouts
6571

66-
`useLayout(layout:string):void` tells the directive which layout to use as default
72+
`defaultLayout(layout:string):void` tells the directive which layout to use as default
73+
74+
`useLayout(layout:string):void` tells the directive which layout to use
6775

6876
`addLayout(layout:string, keys:array):void` expects the name of a new layout to register along an 'keys' array
6977

0 commit comments

Comments
 (0)