We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need the keyboard events to trigger within <input> fields for certain scopes. I have come up with the following solution:
<input>
const registerKeymasterScopeFilter = require('./register-keymaster-scope-filter'); registerKeymasterScopeFilter('input-scope', (e) => (true));
with the register-keymaster-scope-filter.js module looking as follows:
register-keymaster-scope-filter.js
const keymaster = require('keymaster') const defaultFilter = keymaster.filter const scopeFilters = {} keymaster.filter = (e) => { let currentScope = keymaster.getScope() let scopeFilter = scopeFilters[currentScope] if (typeof scopeFilter === 'function') { return scopeFilter(e) } return defaultFilter(e) } module.exports = (scope, filter) => { scopeFilters[scope] = filter }
What are your thoughts on this approach?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I need the keyboard events to trigger within
<input>
fields for certain scopes. I have come up with the following solution:with the
register-keymaster-scope-filter.js
module looking as follows:What are your thoughts on this approach?
The text was updated successfully, but these errors were encountered: