Mousetrap 1.4 introduced a generic mod helper which lets you set cross platform shortcuts.
Mousetrap.bind('mod+p', _print);
On Mac this ends up mapping to command+p whereas on Windows and Linux it maps to ctrl+p.
This differs from defining ctrl+p and command+p because both ctrl+p and command+p will trigger print on Mac whereas with the mod helper only command+p will.
|
||
|---|---|---|
| .. | ||
| admin | ||
| confirm-new-email | ||
| discourse | ||
| discourse-common | ||
| docs | ||
| ember-addons | ||
| locales | ||
| pretty-text | ||
| select-kit | ||
| wizard | ||
| activate-account.js.es6 | ||
| admin.js.erb | ||
| application.js | ||
| auto-redirect.js.es6 | ||
| deprecated.js | ||
| discourse-loader.js | ||
| discourse-objects.js | ||
| discourse.js.es6 | ||
| embed-application.js.es6 | ||
| ember_include.js.erb | ||
| ember_jquery.js | ||
| ember-shim.js | ||
| env.js | ||
| google-tag-manager.js.es6 | ||
| google-universal-analytics.js.es6 | ||
| main_include_admin.js | ||
| markdown-it-bundle.js | ||
| onpopstate-handler.js.es6 | ||
| polyfills.js | ||
| preload-application-data.js.es6 | ||
| preload-store.js.es6 | ||
| pretty-text-bundle.js | ||
| print-page.js | ||
| service-worker.js.erb | ||
| set-prototype-polyfill.js | ||
| template_include.js | ||
| template_include.js.erb | ||
| vendor.js | ||
| wizard-application.js | ||
| wizard-start.js.es6 | ||
| wizard-vendor.js | ||