Update document.

pull/30/head
jaywcjlove 7 years ago
parent 812aad5760
commit b940068785

@ -111,10 +111,10 @@ export default class HotkeysDemo extends Component {
import hotkeys from 'hotkeys-js';
hotkeys('shift+a,alt+d, w', function(e){
console.log('干点活儿',e);
if(hotkeys.shift) console.log('大哥你摁下了 shift 键!');
if(hotkeys.ctrl) console.log('大哥你摁下了 ctrl 键!');
if(hotkeys.alt) console.log('大哥你摁下了 alt 键!');
console.log('干点活儿',e);
if(hotkeys.shift) console.log('大哥你摁下了 shift 键!');
if(hotkeys.ctrl) console.log('大哥你摁下了 ctrl 键!');
if(hotkeys.alt) console.log('大哥你摁下了 alt 键!');
});
```
@ -137,9 +137,13 @@ hotkeys('shift+a,alt+d, w', function(e){
```js
hotkeys('shift+a,alt+d, w', function(e){
console.log('干点活儿',e);
if(hotkeys.shift) console.log('大哥你摁下了 shift 键!');
if(hotkeys.ctrl) console.log('大哥你摁下了 ctrl 键!');
if(hotkeys.alt) console.log('大哥你摁下了 alt 键!');
if(hotkeys.shift) console.log('您摁下了 shift 键!');
if(hotkeys.ctrl) console.log('您摁下了 ctrl 键!');
if(hotkeys.alt) console.log('您摁下了 alt 键!');
if(hotkeys.option) console.log('您摁下了 option 键!');
if(hotkeys.control) console.log('您摁下了 control 键!');
if(hotkeys.cmd) console.log('您摁下了 cmd 键!');
if(hotkeys.command) console.log('您摁下了 command 键!');
});
```

@ -172,10 +172,14 @@ Asterisk "*"
Modifier key judgments
```js
hotkeys('*','wcj', function(e){
if(hotkeys.shift) console.log('shift is pressed');
if(hotkeys.ctrl) console.log('shift is pressed! ');
if(hotkeys.alt) console.log('shift is pressed! ');
hotkeys('*', function(e){
if(hotkeys.shift) console.log('shift is pressed!');
if(hotkeys.ctrl) console.log('ctrl is pressed!');
if(hotkeys.alt) console.log('alt is pressed!');
if(hotkeys.option) console.log('option is pressed!');
if(hotkeys.control) console.log('control is pressed!');
if(hotkeys.cmd) console.log('cmd is pressed!');
if(hotkeys.command) console.log('command is pressed!');
});
```

@ -162,10 +162,14 @@ Asterisk "*"
Modifier key judgments
```js
hotkeys('*','wcj', function(e){
if(hotkeys.shift) console.log('shift is pressed');
if(hotkeys.ctrl) console.log('shift is pressed! ');
if(hotkeys.alt) console.log('shift is pressed! ');
hotkeys('*', function(e){
if(hotkeys.shift) console.log('shift is pressed!');
if(hotkeys.ctrl) console.log('ctrl is pressed!');
if(hotkeys.alt) console.log('alt is pressed!');
if(hotkeys.option) console.log('option is pressed!');
if(hotkeys.control) console.log('control is pressed!');
if(hotkeys.cmd) console.log('cmd is pressed!');
if(hotkeys.command) console.log('command is pressed!');
});
```

Loading…
Cancel
Save