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 Enter button #50

Closed
inovosel opened this issue Apr 5, 2022 · 5 comments
Closed

[FEAT] - Add Enter button #50

inovosel opened this issue Apr 5, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@inovosel
Copy link

inovosel commented Apr 5, 2022

I would like to end typing text into the search input field by pressing Enter, but I'm not sure if there is a way to add Enter key to the keyboard layout.

I've tried using the 'input' event listener on the input field to filter search results as you type so there wouldn't be a need for Enter/Return button, but while the event is triggered while using a real keyboard, it is not triggered when using KioskBoard virtual keyboard.

Adding an Enter button to the virtual keyboard, that would end entry to the input field and remove the onscreen keyboard could solve my problem.

@inovosel inovosel added the enhancement New feature or request label Apr 5, 2022
@Moonbird-IT
Copy link

Moonbird-IT commented Jul 6, 2022

Definitely a workaround but you might switch the focus onto the body element and trigger a click event to hide the keyboard. If you would also like to call a function (i.e. executing a search), something like this might work:

HTML:

<input type="text" id="search-field">

JS:

  let addKeyboard = function(selectorRegular, callback) {
    KioskBoard.Run(selectorRegular);

    $('body').on('click', '.kioskboard-key-enter', function() {
      $('body').focus().click();
      if (callback) {
        callback();
      }
    });
  }

  let executeSearch = function() {
    ...
  }

  addKeyboard('#search-field', executeSearch);

@Adesh66
Copy link

Adesh66 commented Oct 12, 2022

Hey
In my project we need an enter button to close the keyboard. we found that users don't know how to close it.. so sometimes they face issue with keyboard when they are done with their input data.

Can you please help me when it'll be available?

@Moonbird-IT
Copy link

Hello Adesh,
would you need the physical enter key to close the virtual keyboard or are you talking about the virtual keyboard key? If the latter is the case, have you tried what I had posted above (without the callback)?

@Adesh66
Copy link

Adesh66 commented Oct 12, 2022

Hey @Moonbird-IT
I need this enter key in my virtual keyboard. I'm using this in React.

Screenshot 2022-10-12 at 3 01 06 PM

@furcan furcan added this to the v2.3.0 milestone Oct 16, 2022
furcan added a commit that referenced this issue Oct 16, 2022
@furcan furcan mentioned this issue Oct 16, 2022
@furcan
Copy link
Owner

furcan commented Oct 16, 2022

@furcan furcan closed this as completed Oct 16, 2022
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

4 participants