1.0.29 • Published 3 years ago

@gomarky/window-shortcut v1.0.29

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@gomarky/window-shortcut


:cd: Installation

  • via npm: npm install @gomarky/window-shortcut --save
  • via yarn: yarn add @gomarky/window-shortcut

:notebook: List of available shortcuts

  // For all platform
  'Ctrl+A',
  'Ctrl+C',
  'Ctrl+V',
  'Ctrl+Z',
  'Ctrl+Shift+Z',
  'Shift+Tab',
  'Tab',
      
  // For MacOS
  'Meta+A',
  'Meta+C', 
  'Meta+V', 
  'Meta+Z', 
  'Meta+Shift+Z'

:rocket: Usage

import windowShortcut from '@gomarky/window-shortcut'

windowShortcut.registerShortcut('Ctrl+A', () => {
  console.log('Ctrl+A pressed');
})

windowShortcut.registerShortcut('Shift+B', () => {
  console.log('Shift+B pressed');
});

:warning:

⚠️ By default, at every shortcut execute, we prevent default behaviour of browser, by calling event.preventDefault()

⚠️ Note: Available only on desktop devices. Mobile browsers/devices is not support. (Due they don't have keyboards =))

🔓 License

See the LICENSE file for license rights and limitations (MIT).

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.25

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago