nicolasbrailo / PianOli

Android baby game
GNU General Public License v3.0
59 stars 18 forks source link

Add timeout to config unlock #12

Open agschaid opened 5 years ago

agschaid commented 5 years ago

Hi,

the new way to unlock the configs by pressing two different black keys does not appear to be very effective in keeping children away from the settings ;)

Usually my son (16 months) is sliding up and down the piano with both hands at once. That way, just by chance, he unlocks the configs about once every minute.

I'd like to propose a timeout: once the two correct keys are pressed, the user needs to keep pressing them for some time in order to actually unlock the configs. If during that time one of the keypresses is lifted or any other key is pressed, the configs are not unlocked.

I think 300ms should still "feel instantaneous" to grown-ups, yet mitigate "unlock by strafing" scenarios as described above.

nicolasbrailo commented 5 years ago

Thanks for the feedback! I tried making the unlock use 3 keys instead of 2, but my own tests with grown-ups showed it made the feature a bit hard to discover. A timeout seems like a good idea to reduce the chance of an accidental trigger without making the feature harder to discover.

I don't think I'll have time to implement this feature in the next few months, though. Pull requests would be more than welcome!

agschaid commented 5 years ago

Noted ;) Of course as target audience (parent of young kids) I don't have too much time. But I'll see what I can do ;)

nicolasbrailo commented 5 years ago

Yeah, free time stops being a thing, right? I will eventually get to this change, but as a parent of a 2 year old who just moved to a new country... by the time I do, your kids might not be interested in this app anymore hahaha

agschaid commented 5 years ago

exactly my thinking ;) so expect to see a pull request in the next weeks.

I like to think of my self as an experienced java developer. But never did ANY Android development. Can I hassle you if I encounter a road block that I don't even understand?

nicolasbrailo commented 5 years ago

expect to see a pull request in the next weeks.

That would be AWESOME! Thank you so much!

I don't think I'm particularly good at Java NOR Android, so I hope you don't get too horrified at the source code. Having said that, I'll help in every way I can.

Most of the config display logic is bundled in /app/src/main/java/com/nicobrailo/pianoli/AppConfigTrigger.java so I'm hoping any timeout changes should be mostly self-contained in that class.

Cheers!

agschaid commented 5 years ago

great. thanks for the kickstart info. I suspect 80% of my time will be figuring out how to run and test the app . . .

And: you created a thing in your spare time (!) that helped me to get countless naps . . . I am NOT going to judge your code :D

agschaid commented 4 years ago

almost 1 year passed and I did . . . nothing

I'll TRY to provide a PR but if you want to close the issue in a month or so I would not be angry ;)

nicolasbrailo commented 4 years ago

Github isn't charging me per open issue, so no worries :)

pserwylo commented 3 years ago

What would those here think about something similar to what I've implemented for BabyDots, whereby the person touching the phone needs to touch the same icon X times consecutively within a time period of Y milliseconds?

From experimentation it seems to work well (easy for an adult, hard for a baby).

Thoughts?

(Kotlin) code from Babydots: https://github.com/babydots/babydots/blob/a3589c9a054c8434f75a47c89c4766913e59a5e2/app/src/main/java/com/serwylo/babydots/MainActivity.kt#L142

Link to F-Droid so you can test the UX to see if it works well or not: https://f-droid.org/packages/com.serwylo.babydots/

nicolasbrailo commented 3 years ago

@pserwylo I think the this app used to work the same way, then I changed it because closing the app became my daughter's favorite action. This issue may also be relevant; https://github.com/nicolasbrailo/PianOli/issues/7

With that said, I'm not against the change. If you're working on a PR to implement it, my only request would be to make it easy to rollback. This week a new beta-tester arrived at my place, so if in a few months I find the change doesn't work for me I'll make it configurable :)

pserwylo commented 3 years ago

This week a new beta-tester arrived at my place

Congratulations!

Thanks for the pointer to #7. After reading that, I think we should just leave my proposition as unimplemented for now. No need to go back to something that used to be there but was provably unhelpful. I guess I'm lucky with BabyDots that 15 month olds probably wont like that app anyway, it is more for immobile infants. Hope it helps with your new little one as they get a couple of months older ;)

annihat commented 3 years ago

Can I suggest that a number of exits be configurable, please, with each being able to be turned off as the child discovers them?

annihat commented 3 years ago

Can I suggest another possible exit, please?

Each key has a random letter on it, changing every keypress, with one letter guaranteed to be "E", then as soon as that is pressed one letter guaranteed to be "X", followed by "I" & "T" in sequence.

yamatt commented 3 years ago

My 6 month old gets to the settings pretty regularly. He's done it at least 3 times in a 5 minute period.

He uses one or two hands to slide his fingers around and just so happens to hit the settings keys.

He has also inadvertently changed the instrument before I've been able to wrestle back control.

I do think a timer in the settings key should fix this. He only places his fingers on the correct keys for the shortest time.

If the settings keys had a delay of ¼ of a second I'm sure most of the instances of this happening would stop.

nicolasbrailo commented 3 years ago

With #32 fixed, it should be a bit harder to trigger the settings by monkey smashing they keys. A timeout would still be nice, but that's a bit more work to implement.

juleskers commented 8 months ago

It's now 4,5 years since the original report, and we've solved multiple bugs in the unlock-sequence, specifically adding a reset-on-wrong-key in #32 and fixing the "stuck keys" (which counted for settings-opening) from #40.

In that time, the original escape-artist child must have become a schoolgoing-child (who probably lost interest in PianOli), and I ascended from drive-by issue reporter to contributor.. My how time flies!

I'll keep this issue open for now, but If we still haven't heard a renewed sighting by December 2024, I plan on closing it as "solved". Happy Holidays everyone! :snowman_with_snow: (and a :surfer: for those on the southern Hemisphere :wink: )

agschaid commented 8 months ago

hi!

the escape-artist will be going to school next fall . . . and I felt bad for years for not finding the time to contribute anything . . . as you said: time flies . . .

I'll give my mobile to my fuzzy-tester once again during the hollidays and ask him to do his magic. I'll let you know if he manages to unlock the settings ;)

juleskers commented 8 months ago

Thanks @agschaid!

Please don't feel bad on our account! by contributing this issue (and bug reports and suggestions really are contributions!) you've already contributed more to pianoli than ~6,999,999,980 other humans on this planet ❤️ 😜

Thanks for making your fuzzy-tester available!

RustoMCSpit commented 5 months ago

App is pinned message says "swiping up" gets you out of it but for me, getting out of it requires doing the cog settings thing. this is very confusing. having the app automatically pinned every time you open it should be an option which can be turned off in settings, i find it tedious and detrimental.

juleskers commented 2 months ago

@RustoMCSpit thanks for the feedback! ❤️

If you dislike our "cog-dance", I am guessing you are using our app for something other than as a baby-distraction-screenlocker (for which we designed it) . Could you tell us about how you use it?
It's always good to learn more about our audience, and since we don't do any tracking, github comments are our only input ❤️

The "swipe up" message comes directly from Android. It is there to prevent malicious apps from silently stealing your screen and recording everything, Android doesn't allow apps any influence on this. In our experience, wildly swiping baby fists escape from the normal app-pinning to easily, which is why we added the cog-dance.

RustoMCSpit commented 2 months ago

Could you tell us about how you use it?

i use it as a way to make simple melodies when im away from my piano.

Android doesn't allow apps any influence on this.

this could be mentioned in the cog menu that the message is irrelevant