Help with keyboard for BangleJS2 - Multitap/T9 layout #4685
Replies: 1 comment
-
Posted at 2022-05-04 by Sir_Indy Nevermind, got it. A keyboard needs to look something like this:
I'll wrap it up into an app next. Posted at 2022-05-04 by @gfwilliams Great! I look forward to seeing it in action ;) Posted at 2022-05-06 by Sir_Indy It's ready, if anyone wants to try it out: https://sir-indy.github.io/BangleApps/?id=kbmulti I'm probably going to tweak it some more, try a few different fonts on the buttons to see what looks clearest. Any feedback please let me know, I've found that with just a little practice I'm now quite accurate and quick with it. Posted at 2022-05-06 by @thyttan Nice one, I like this! Feature suggestions:
What do you think? I might try and add some of these suggestions :) Edit: EDIT2: I've messed something up, it doesn't exit correctly. I don't really grasp how promises work, and how to make Bangle.on('swipe' ....) stop, after the promise has resolved the text. Here's the code. Posted at 2022-05-09 by Sir_Indy Hi @thyttan, thanks for your feedback and suggestions! It's great to have someone excited by something you've made! Going point-by-point:
Posted at 2022-05-09 by @thyttan Just regarding user defined duration, I wanted a shorter duration, around 225-300 ms works good for me. I felt 750 ms was a little long - that I had to wait too long to make for example two A's. Posted at 2022-05-09 by Sir_Indy @thyttan, I've made some progress with the swipe issues, turns out you need to I'm having the opposite problem with the help screen though, tap the text to open the help screen, press ok to go back, and all the buttons in the layout stop responding. I'll look into this as I've had the problem before in my timer app, and fudged it with a custom onTouch, but it looks like we need a proper solution. I'll add your setting for duration in later, for now shortened to 500ms, any less for me and I can't press the buttons quickly (and accurately) enough. Shows why a setting is a good idea! (EDIT: tried to download a screenshot, came as a .dib format, attached to the message fine, but no preview image. Tried to remove and replace with a converted PNG version, error) Posted at 2022-05-09 by @thyttan Ah, great about Bangle.removeListener()! Generating the layout anew when exiting onHelp() makes the buttons pressable. I suspect there's a better way to do it though. What I changed (line 1, 7, 12 and 41 below):
.
Posted at 2022-05-10 by Sir_Indy Thank you, you're right generating the layout again seems to be the only way to do it at the moment. It feels like there should be a better way, but it works. Great idea to pop up the help message on first launch! Very nice way to make it clear to the user how to use the app. I think I'll use that in future apps too, so thank you for that. I'll make these changes and submit a pull request. How do you want to be credited? It seems most apps have a link to the original author Github Page, do you want your name on it as @thyttan or thyttan? Posted at 2022-05-10 by @thyttan Ok, nice! I'd be happy to be credited as my github alias 🙂 Posted at 2022-05-10 by Sir_Indy Pull request opened here: espruino/BangleApps#1814 Posted at 2022-05-11 by Sir_Indy And done! Thank you @gfwilliams for accepting the pull request, I really am having fun with this project! Posted at 2022-05-11 by @thyttan Thank you for the keyboard, collaboration and being generous with the crediting :) I've done some more tweaks that can be tested here. Code here.
I have noticed a problem with how I implement the marker. If I exit the keyboard before characterTimeout has run out the displayText()-function displays over the noteify-screen. Thoughts? :) Posted at 2022-05-12 by Sir_Indy Hi, they sound like good changes, good idea. I suspect you can fix the exit problem by clearing the charTimeout in the 'back' function of the layout. Use the same code as in the backspace and onKeypad function. Now that chunk will be used in 3 places you could wrap it up as it's own clearTimeout function if you want. Hope that helps! Posted at 2022-05-15 by @thyttan Thanks for the tip! Just opened a pull request. Can be tested here. Code here. Small bug:
Suggested future improvements:
Posted at 2022-05-16 by Sir_Indy Hi @thyttan, I've seen the bug with the ok-button shrinking the text, but in the alarm message, so it's not something we've changed here. It may be something that I've broken when I tweaked the layout library, I'll look into it. Align buttons: Annoyingly, that is something else I changed then accidentally overwrote my code and missed it! Easy to fix though, at the start of the code put Posted at 2022-05-16 by @thyttan My mistake, I tested some changes I did to Desktop Launcher and left that branch on my github pages/app loader. I've changed back to my kbmulti branch now. Ok, I'll try and add the button alignment before the pr gets merged! Posted at 2022-05-16 by Sir_Indy Yep, that works! All looks good to me. I particularly like the marker, having a visual indication for when the letter is locked in really helps. Do you mind sharing how you change branch in GitHub? I've been working on one thing at a time because the checking script and pages only work on the main branch. Switching between branches would be very helpful! Posted at 2022-05-16 by @thyttan First, I presume you already went through this guide. On your fork start page, click the branch-button that says 'master' -> then enter a new branch name in the text input box -> then click 'Create branch: ....' See if the screenshots below help you. After that you can choose which branch should be published on your github-pages, by on your fork start page going 'settings' -> 'Pages' -> 'Source' -> select branch in drop-down list. Attachments: Posted at 2022-05-16 by @thyttan Also, maybe you find my answer here regarding resetting a branch relevant at some point. Posted at 2022-05-16 by Sir_Indy
Thank you! That looks like what I was missing, that'll be very helpful! GitHub/Git in general is still new to me, but I'm learning a lot here. Posted at 2022-05-16 by @thyttan No problem! The same goes for me! :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-05-04 by Sir_Indy
Hi all,
Safe to say I've got the bug for writing apps for the Bangle2! But I'm not very experienced with javascript, and confused how to turn what I've written into a keyboard.
See here for an example of my multitap/T9 keyboard, using the layout library and the logic from here:
https://gist.github.com/sir-indy/12f334440894091fc7e64f7444df54c5
Try it out by loading it onto your watch as filename
textinput
, then use the Noteify app to try and write something.It can write text quite happily, but I'm stuck returning it to the app. Something to do with
resolve(text)
, but not sure what a resolve is, or how to get it to work. Can anyone offer any suggestions?Beta Was this translation helpful? Give feedback.
All reactions