keyboard-shortcut-map-maker icon indicating copy to clipboard operation
keyboard-shortcut-map-maker copied to clipboard

Numpad keyboard

Open pesseba opened this issue 4 years ago • 2 comments

There is a way to add a numpad keyboard?

pesseba avatar Mar 21 '22 14:03 pesseba

I've just added some code to branch v1.0.1 that crudely implements a full sized keyboard. It is unpolished and looks a little rough around the edges, but if you're only looking for the functionality of colouring and adding labels to keys then it should work fine. No other features have been tested yet so no guarantees of anything else working.

As far as adding layouts go, it should be fairly simple to modify and add your own custom layouts, and I am happy to merge them.

It should be a case of adding a

<ol id="templateList">
  ...
  <li id="templateXYZ">
        <span class="up"></span>
        <span class="down"></span>
        <h3 style="float: left;" class="editable">DEFAULT HEADER TEXT</h3>
        <p style="float: right; font-size: 18px;" onclick="removeKeyboard($(this.parentNode));">🚮</p>
        <div>
            <!-- KEYBOARD HERE -->
        </div>
  <li/>
  ...
</ol>

Where inside the keyboard div every key is represented as <div data-key="F1" class="key">F1<span class="userText"></span></div> etc.

Archie-Adams avatar Mar 21 '22 16:03 Archie-Adams

As well of course as a snippet like:

$(document).on("click", "#ADDNEWTEMPLATE", function () {
  var template = $("#templateXYZ").clone();
  template.removeAttr('hidden');
  template.removeAttr('id');
  $(template).find('div:first').prop('id', 'kbd' + new Date().getTime());
  template.appendTo("#KeyboardTable");
});

And a button with id="ADDNEWTEMPLATE" to go with it.

Archie-Adams avatar Mar 21 '22 16:03 Archie-Adams