@gomarky/window-shortcut

1.0.29 • Public • Published

@gomarky/window-shortcut


💿 Installation

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

📓 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'

🚀 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');
});

⚠️

⚠️ 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).

Readme

Keywords

Package Sidebar

Install

npm i @gomarky/window-shortcut

Weekly Downloads

113

Version

1.0.29

License

MIT

Unpacked Size

6.66 kB

Total Files

6

Last publish

Collaborators

  • teodor_dre