I've hit a roadblock with my Chrome Extension development. Despite using two different methods to add keyboard functionality, the keys "/" for divide and "." for decimal on the keypad are just not registering. I've attempted to tackle this issue using two libraries: and . The code I'm using, which I'll share below, works fine except for those specific keys for reasons unknown. It's unclear if I'm implementing it incorrectly or overlooking something, so any guidance to resolve this dilemma would be immensely appreciated.
Thank you in advance!
// consoles "print!" when pressed
jwerty.key('[num-0-num-9]', function () { console.log('numpad number') });
jwerty.key('[0-9]', function () { console.log('regular number') });
//jwerty.key('111', function () { console.log('decimal!') });
jwerty.key('enter', function () { console.log('enter!') });
jwerty.key('+', function () { console.log('plus!') });
jwerty.key('-', function () { console.log('minus!') });
jwerty.key('*', function () { console.log('multiply!') });
//jwerty.key('110', function () { console.log('divide!') });
jwerty.key('shift+9', function () { console.log('(!') });
jwerty.key('shift+0', function () { console.log(')!') });
The attempts with "110" and "111" were just part of multiple trying efforts. I'm aware they're incorrect.
//button catcher -- keyboard
$(document)
.makeKeyCombinator(
{
onComplete: function(keyComboData)
{
$(".temp").html('<pre class="prettyprint">' + JSON.stringify(keyComboData, null, 2) + '</pre>');
var keys = ExtractKeys(JSON.stringify(keyComboData, null, 2));
$(".temp").append('<pre class="prettyprint">' + JSON.stringify(keys, null, 2) + '</pre>');
}
});
Given the use of two different libraries, the solution is likely a simple oversight, but any assistance provided to overcome this hurdle would be greatly welcomed.