sspanak / tt9

A T9 keyboard for Android devices with a hardware keypad.
Apache License 2.0
248 stars 43 forks source link

Swipe left to delete last word #333

Open maverick74 opened 1 year ago

maverick74 commented 1 year ago

On the on-screen keyboard, it would be nice if we could swipe left on the delete button to delete the last word!

Its not an essential feature, just a nice one!

sspanak commented 1 year ago

This may be a bit tricky, but I think it is possible by handling MotionEvent.ACTION_MOVE in SoftKey.onTouch() then and using it in SoftBackspaceKey, possibly with a handleSwipe() function.

maverick74 commented 7 months ago

I've been thinking about this...

Instead of swipe maybe a Tap+LongTap (as in "holding the delete") could be easier...

And if you keep holding it, it would keep on deleting one word at a time...

sspanak commented 7 months ago

Swipe to delete sounds good to me, there is no need to make it more complicated. I haven't researched how to do it, though.

One more thing, deleting more than one character at a time will become easier after #170, when it will become possible to select text and cut/copy/paste/delete with a single click. The selection method itself is described in a kind of complicated way, but I think I have ideas how to make it simpler.

However, as of now, I am focused on other features. This will not be released anytime soon.

maverick74 commented 7 months ago

No pressure!

My intention is not to speed this up or something, it's just to share "way outs" (It's also not that "you don't know what you're doing" or something like that. It's just that there are various ways to accomplish one effect and sometimes we don't remember every single one... It's my way to try to help...)

sspanak commented 7 months ago

No worries, I'm from the Balkans, I don't get offended for nothing. :slightly_smiling_face:

I'm also sharing my opinion. I've seen the swipe-to-delete function in other keyboards, so I think it is intuitive and relatively easy to do. For this reason, I like it better.

sspanak commented 2 months ago

408 makes this obsolete. Deleting entire words will be possible by holding backspace instead of swiping. Holding is easier to implement and allows for consistency with hardware keypads.

maverick74 commented 2 months ago

But won't accelerating it cause loss of control of exactly what we want to delete?

Swiping left would allow deletion of "just" the last word! And, if holding it, it would delete one word at a time...

this would, probably, give users more control of the deletion process...

(but, then again, I have no idea of how you're doing it so it may work...)

sspanak commented 2 months ago

There will be a slight delay, so you will be able to stop at the right time. See the attached video.

https://github.com/user-attachments/assets/63ed4c9b-59bd-4cb3-9507-0b32db1ccd2d

maverick74 commented 2 months ago

There will be a slight delay, so you will be able to stop at the right time.

Hum, I see!!! It might work.... I still have some doubts about deleting a single word but I'll say more after I put my fingers on it 😀! You got me half convinced with the video 🤣

sspanak commented 1 month ago

Never mind, I was able to add swiping to all buttons. To be honest, the effort was really worth it. The code looks much nicer and cleaner, and on top of that, I was able to use it for resizing too.

maverick74 commented 1 month ago

I'm not exactly sure if i should open a new bug report or not because i'm not sure i can say it's a bug:

still, sometimes, swiping left deletes more than one word (sometimes, it apparently stops in the middle of another word).

the thing is: i can only seldom replicate it... maybe i'm doing something wrong... if you @sspanak think it's worth it, i'll submit a bug report... but it's a tricky thing............

sspanak commented 1 month ago

v39.0 will probably fix that. I've noticed there is a bug which sometimes causes accidental double click or click and swipe, or hold and swipe within a couple of milliseconds, which would cause Backspace to delete more characters than expected.

If the problem persists even after updating to v39.0, please create a new bug.

maverick74 commented 2 weeks ago

It REALLY is a lot better!!!

But, sometimes, it still happens some weird deletions!

Do you think

https://github.com/sspanak/tt9/commit/d47528f5502757863b75faaa962c32edab23d63e

may help or will we need to try to track it?

sspanak commented 2 weeks ago

It still happens sometimes. I'll have to revisit that part of the code. I don't like it anyway, it is overcomplicated.

Edit: I made it even more complicated but I hope it finally works! I'll test it in the following days and if everything is fine, I'll push the new release.