M Mostez Well-Known Member Licensed User Longtime User Oct 3, 2016 #1 Hello, This is not the best B4R code to scan matrix keypads, it is just a try, just wanted to share the idea with you, you may like to enhance and modify it as needed. but i have a question here, I could not do this, 'wait for a key press', the loop blocks scanning timer. any ideas to do so? is there a way to direct program to wait for something to happen like pin state or key press in my case, then branch it again according to results! B4X: Expand Collapse Copy Do Until KeyValue = KEY_0 Loop Log("a key is pressed") thanks Attachments keypad.zip keypad.zip 16.3 KB · Views: 621
Hello, This is not the best B4R code to scan matrix keypads, it is just a try, just wanted to share the idea with you, you may like to enhance and modify it as needed. but i have a question here, I could not do this, 'wait for a key press', the loop blocks scanning timer. any ideas to do so? is there a way to direct program to wait for something to happen like pin state or key press in my case, then branch it again according to results! B4X: Expand Collapse Copy Do Until KeyValue = KEY_0 Loop Log("a key is pressed") thanks
Erel B4X founder Staff member Licensed User Longtime User Oct 4, 2016 #2 No. You shouldn't try to hold the main (and only) thread. You should instead raise an event when something happens. Upvote 0
No. You shouldn't try to hold the main (and only) thread. You should instead raise an event when something happens.
M Mostez Well-Known Member Licensed User Longtime User Oct 4, 2016 #3 OK Erel, in this code I raise an event (KeyPressed) may I ask for simple example how to trap such event, just want to implement something like that; print(yesNo) if pressed yes Sub1 else Sub2 end if Thanks so much Upvote 0
OK Erel, in this code I raise an event (KeyPressed) may I ask for simple example how to trap such event, just want to implement something like that; print(yesNo) if pressed yes Sub1 else Sub2 end if Thanks so much
Erel B4X founder Staff member Licensed User Longtime User Oct 4, 2016 #4 I plan to create a library for keypads. It will be available in two to three weeks. Upvote 0
M Mostez Well-Known Member Licensed User Longtime User Oct 4, 2016 #5 It will be so great, Thanks Upvote 0
M Mostez Well-Known Member Licensed User Longtime User Oct 22, 2016 #6 will we see version 1.0 soon Erel? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 23, 2016 #7 I'm still waiting for it to arrive. It is a holiday month here so everything is slower. Upvote 0