Skip to content

[FEAT] - Add custom keys next to kioskBoardAllKeysNumbers #97

@gdesor

Description

@gdesor

I would like to be able to add special characters next to the numbers in the full keyboard. Like this one => '
This allows me to not put it in the full list of characters, and have quick access to this often used character.

For this I modified the source code in the style of keysNumpadArrayOfNumbers

 var kioskBoardDefaultOptions = {
    keysArrayOfObjects: null,
    keysJsonUrl: null,
    keysSpecialCharsArrayOfStrings: null,
    keysNumpadArrayOfNumbers: null,
//VAR ADDED
    kioskBoardAllKeysNumbers: null,
//END
          // keyboard type is "all" or "keyboard": begin
          if (keyboardType === kioskBoardTypes.Keyboard || keyboardType === kioskBoardTypes.All) {
            // only keyboard type is "all": begin
            if (keyboardType === kioskBoardTypes.All) {
            
//LINES ADDED
            var numpadKeys = opt.kioskBoardAllKeysNumbers;
            if (Array.isArray(numpadKeys)) {
              kioskBoardAllKeysNumbersObject = numpadKeys.reduce(function (numpadMemo, numpadKey, numpadIndex) {
                numpadMemo[numpadIndex] = numpadKey;
                return numpadMemo;
              }, {});
            }
//END

Then I can set this kioskBoardAllKeysNumbers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, "'"], in KioskBoard.init function.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions