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

Is it possible to detect multiple buttons pressed at the same time #52

Open
lzakrzewski opened this issue Aug 27, 2024 · 1 comment
Open

Comments

@lzakrzewski
Copy link

Hello,

I'm trying to figure out if there is a way to detect that many keys are pressed simultaneously, so I can support combinations of pressed keys.
Any idea?

Thanks

@arastaskiran
Copy link

Last week, I created a similar library for a PoC. To improve it further, I was reviewing the issue pages of similar libraries when I came across your question. I added this feature to my library, so if it helps you, I'm sharing the link and implementation suggestion below.

https://github.com/arastaskiran/RustyKeypad/

#include <Arduino.h>
#include <rusty_keypad.h>




void textChange(String text)
{
  Serial.println(text);
}

void multipleKeys(String text)
{
   Serial.println(text);
}

void setup()
{
  Serial.begin(9600);

  RustyKeypad::addTextChangeListener(textChange);
  RustyKeypad::addMultipleKeyListener(multipleKeys);
  RustyKeypad::setType(RKP_INTEGER);
  RustyKeypad::enable(); 
  
}

void loop()
{
  RustyKeypad::scan();
  // put your main code here, to run repeatedly:
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants