Can you provide the keycodes for the numpad keys: "/" and "." specifically for the libraries I am utilizing or any other library that does not overlook them?

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.

Answer №1

Here are the specific codes for the keys you are looking for:

"/" = 191 | Numpad : 111

"." = 190 | Numpad : 110

Check this site for reference:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize state objects and child components by accessing sub-values within the object

I have a Dropzone component where multiple uploads can happen simultaneously and I want to display the progress of each upload. Within my Dropzone component, there is a state array called uploads: const [uploads, setUploads] = useState([]) Each element i ...

What is the process for including an additional button in the DateTimePicker feature of material UI?

I'm currently utilizing DateTimePicker in my React application. I wish to incorporate a Clear button positioned to the left of the Cancel Button. import { MuiPickersUtilsProvider, DateTimePicker } from "@material-ui/pickers"; import DateFnsUtils fro ...

Simple CSS and HTML trick for creating a seamless hide and hover effect

Every time I've attempted this task in the past, it has been straightforward. However, this time it's proving to be challenging. The goal is simple - have an image display a description when hovered over by a user. HTML: <div class="descript ...

What is the main focus of the active view in MVC2?

So, you can find my website at www.kristianbak.com. I've created a CSS class named activebutton, but I want it to dynamically change when another view is active. Right now, it's statically coded in the HTML (sitemaster). Does anyone have a clev ...

What is the process for jQuery to manage errors with cross domain requests?

Given that there is no callback method defined beforehand, the code snippet below shows how jQuery handles ajax events success and error: jQuery.ajax({ url: 'url', type: 'GET', data: {}, ...

Conflict between iOS 7+ swipe back gesture and stateChange animations

When transitioning between states in an AngularJS application, I utilize CSS animations to add visual appeal to the view change. This may involve applying fades or transforms using classes like .ng-enter and .ng-leave. In iOS 7+, users can swipe their fin ...

What methods can I employ to utilize a JSON response generated by PHP within jQuery?

Currently, I am in the process of creating a website and I'm working on gathering all the reviews stored in the database. Initially, my approach was to utilize PHP in the following manner: function get_all_reviews(){ $db = dbConnection(); $db ...

What is causing elements like divs, paragraphs, or text not to display within an ion-item after an ion-input is added?

I am currently working on validating a simple form and everything seems to be functioning properly. However, I have encountered an issue with displaying text messages within an ionic 3 list item. The ion-item consists of an ion-input element. When I place ...

React component for a background image with a gradient overlay

I'm facing an issue trying to incorporate a background image for a div along with a color overlay. In plain CSS, the code would typically look like this: .backgroundImage { background-image: linear-gradient(to bottom, rgba(245, 246, 252, 0.52), rg ...

Electron fails to display images in the compiled version

I'm currently troubleshooting an issue related to displaying images using CSS in my electron project. In the latest version of the application, the images are not showing up when linked from a CSS file. However, in a previous version, the images disp ...

gulp-minify-css-names not altering any files during processing

For quite some time, I have been on the search for a solution that can assist me in automating the process of renaming/minifying class names in HTML, JS, CSS files simultaneously throughout my entire project using gulp. While there are many solutions avai ...

Manipulate the value of an HTML element's style parameter with jQuery

How do I change an element's style property using jQuery? This is the HTML code I am working with: <div id="template" style="width:200px; height:200px; border:none;">blabla...</div> I attempted to do this: $('#template').attr ...

CAUTION: Attempted to load angular multiple times while loading the page

I encountered a warning message while working on my project, causing errors in calling backend APIs due to duplicate calls. Despite attempting previously suggested solutions from the forum, I am stuck and seeking assistance. Can anyone provide guidance? Be ...

Creating a new object through manipulation of existing objects

In my attempt to transform an existing object into a new object structure, I am facing some challenges. Here is the current data set: const jsonStructure = { "a11/a22/animations": "snimations", "a11/a22/colours": "sl/colours", "a11/a22/fonts" ...

Understanding JavaScript Regular Expressions

To ensure that no HTML tags are entered into a textarea, I am utilizing the following regex for validation. If any HTML tags are detected in the textarea, I need to display a validation message. The regex being used is: /<(\w+)((?:\s+\w ...

Enter key always causes the Bootstrap form to submit

I am working with a jquery function: $("#get-input").keyup(function (event) { if (event.keyCode === 13) { $("#get-data").click(); } }); $("#get-data").click(function (e) { var endpoint = $(".get-input").val(); if ($('#data-d ...

The ng-click functionality is not functioning as expected within the directive

Take a look at this snippet of my HTML: <section ng-controller="GalleryController as gallery"> <nav footer-directive></nav> </section> This is the GalleryController I'm using: angular .module('myapp') ...

How can I replicate the function of closing a tab or instance in a web browser using Protractor/Selenium?

I want to create an automated scenario where a User is prompted with an alert message when they try to close the browser's tab or the browser itself. The alert should say something like "Are you sure you want to leave?" When I manually close the tab ...

successful ajax call encountered a problem

Here is the code snippet in question: $.ajax({ type: "POST", url: "/Member/SaveMember", data: $('form').serialize(), success: refreshGrid() I'm confused as to why the refreshGrid() method is being called before the ajax call to /Member/Sav ...

Tips for placing a background color *behind* a bootstrap button

When a button is clicked, I want to display an input with a background surrounding both the button and the input. Currently, my markup renders like this: https://i.sstatic.net/rxaPt.png So when the button is clicked, I need a yellow (alert-warning) backg ...