Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gdesor opened this issue Sep 30, 2024 · 0 comments
Open

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

gdesor opened this issue Sep 30, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gdesor
Copy link

gdesor commented Sep 30, 2024

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.

@gdesor gdesor added the enhancement New feature or request label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants