Added physicalKeyboardHighlightPress option. Fixes #735

This commit is contained in:
Francisco Hodge
2020-10-20 20:54:31 -04:00
parent 114f82525f
commit 56fc194ad6
12 changed files with 120 additions and 29 deletions
@@ -113,4 +113,57 @@ it('PhysicalKeyboard will work with F1-F12 keys', () => {
tagName: "input"
}
}));
});
it('PhysicalKeyboard will work with physicalKeyboardHighlightPress', () => {
setDOM();
new Keyboard({
physicalKeyboardHighlight: true,
physicalKeyboardHighlightPress: true,
debug: true
});
document.dispatchEvent(new KeyboardEvent('keydown', {
code: "KeyF",
key: "f",
target: {
tagName: "input"
}
}));
document.dispatchEvent(new KeyboardEvent('keyup', {
code: "KeyF",
key: "f",
target: {
tagName: "input"
}
}));
});
it('PhysicalKeyboard will work with physicalKeyboardHighlightPress (touch)', () => {
setDOM();
new Keyboard({
physicalKeyboardHighlight: true,
physicalKeyboardHighlightPress: true,
useTouchEvents: true,
debug: true
});
document.dispatchEvent(new KeyboardEvent('keydown', {
code: "KeyF",
key: "f",
target: {
tagName: "input"
}
}));
document.dispatchEvent(new KeyboardEvent('keyup', {
code: "KeyF",
key: "f",
target: {
tagName: "input"
}
}));
});