Android Question SOLVED - Button (Key Down) not working as I think it should

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I am trying to handle a button down and hold by handling the down and up routines.

But when pressing and holding a button I seem to get Down, Up then Down........ (which stays down until I let it up) and then I get the Up.

Seems like it should be Down until I release it

Trying to make the buttons work like a remote would when you hold the key down.

Attached a strip down version to show the effect.

BobVal
 

Attachments

  • TestKeys.zip
    21.3 KB · Views: 95

drgottjr

Expert
Licensed User
Longtime User
not saying i agree with your vision, but just fyi: i was able to succeed with a single down until released several times with a "down" arrow and once with the "left" arrow. that is, no initial down-up sequence. the others arrows were too awkwardly placed for me (left-handed and holding device with right hand) to touch at the correct angle. if i can train my dog to touch the arrows or to hold the device, that frees up a hand for a video camera. unless you've solved this or given up, i'm going to think about adding some dotted lines to the log (eg, on key up) to separate the tries. then you could see. the left arrow down was, like, one in 6 or 7 tries.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
here. i got 1 on the second try. the first 3 entries are the involuntary down-up-down. when i saw that in the log, i released the button (up).
the next entry is a single press down and hold. i counted to 10 and released (up).
 

Attachments

  • down-up.png
    down-up.png
    12.5 KB · Views: 90
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
The code above was (is) just a test.

On my Samsung s7 sometimes I get two ups and downs for one click some times not.
Press and hold almost every time gives me Down, Up, Down .... (for how long as I hold key) then Up

On my Samsung Tablet (SM-T280) works perfectly every time Down (for long as I hold key) the Up.

Wonder if there is something S7 to make it work properly.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Sorry about that. Pulled up an Old Beginners Guide (from 2012) and they were listed there. Didn't give it any thought.

Converting to SwiftButton
 
Upvote 0
Top