Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swipe left to delete last word #333

Open
maverick74 opened this issue Aug 1, 2023 · 23 comments · Fixed by #625
Open

Swipe left to delete last word #333

maverick74 opened this issue Aug 1, 2023 · 23 comments · Fixed by #625
Labels
enhancement New feature or request

Comments

@maverick74
Copy link

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
Copy link
Owner

sspanak commented Aug 3, 2023

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.

@sspanak sspanak added the enhancement New feature or request label Aug 3, 2023
@sspanak sspanak added this to the Popular requests 3 milestone Aug 3, 2023
@maverick74
Copy link
Author

maverick74 commented Mar 25, 2024

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
Copy link
Owner

sspanak commented Mar 26, 2024

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
Copy link
Author

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
Copy link
Owner

sspanak commented Apr 6, 2024

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

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
Copy link
Owner

sspanak commented Aug 26, 2024

#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.

@sspanak sspanak linked a pull request Aug 26, 2024 that will close this issue
@maverick74
Copy link
Author

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
Copy link
Owner

sspanak commented Aug 26, 2024

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

screen-20240826-201239.mp4

@maverick74
Copy link
Author

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 sspanak removed a link to a pull request Aug 29, 2024
@sspanak sspanak linked a pull request Sep 10, 2024 that will close this issue
@sspanak
Copy link
Owner

sspanak commented Sep 12, 2024

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
Copy link
Author

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
Copy link
Owner

sspanak commented Oct 3, 2024

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
Copy link
Author

It REALLY is a lot better!!!

But, sometimes, it still happens some weird deletions!

Do you think

d47528f

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

@sspanak
Copy link
Owner

sspanak commented Oct 23, 2024

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.

@sspanak sspanak reopened this Oct 23, 2024
@maverick74
Copy link
Author

Almost perfect!!!!!

It indeed improved a LOT!!!!

BUT... it occasionally when I "simple" tap delete, instead of deleting a single letter it deletes the whole word!!!

@maverick74
Copy link
Author

I've been trying to replicate it but I don't really seem to be able to find the way!!!

It happened to me 3 or 4 times in this same message with "been" but I don't seem to find the path...
maybe it's my fault... maybe I slide on delete and don't notice it or something...

@sspanak
Copy link
Owner

sspanak commented Nov 10, 2024

There are three possible reasons for this.

First, there still may be some flaw in the logic, that fails because of a specific sequence of letters and special characters. I believe I solved all such problems, but just in case, could you please share the entire message with the surrounding spaces and new lines, if any? Provided that it does not contain any personal information, of course.

Second, if the device lags a little, it becomes very difficult to distinguish between a click and a swipe. I am talking about lagging for very short time intervals, less than 60 ms. In this case, I can provide an alternative key operation. Backspace could delete one character when released, instead of when pressed. This should solve the problem completely, but it may feel Backspace is lagging, if you lift up your finger slowly. And that's the reason I haven't implemented it until now.

Third reason, due to lagging or due to too much customization by your device manufacturer, pressing the virtual keys may produce an ACTION_MOVE event without first producing an ACTION_DOWN event. If I remember correctly, there was some problem with registering the exact moment the finger touches the screen on my Energizer H620S. I can attempt to fix this, too.

So here is what we can do (I'll need your help again). I will prepare a new APK, based on v40.0, with two settings to toggle fixes 2 and 3. You will have to install it and try each fix for a couple of days, then let me know if any of them worked.

@maverick74
Copy link
Author

maverick74 commented Nov 10, 2024

Yeah, probably lagging may have something to do with it!

We can try the options you mentioned!

But, if it's just me I don't know if it's worth the work...

@maverick74
Copy link
Author

Oh and i forgot to reply to this:

could you please share the entire message with the surrounding spaces and new lines, if any?

that was my previous message: #333 (comment)

I was typing the word "been" on that massage when it happened. I typed "ben" (instead of "been") and since there was an "e" missing i was trying to delete the "n" to type the second "e" and it just deleted the whole word instead.

When it happened i tried to figure out how it happened. i must have tried some ~15 times. On the first ones (lets say 6 or 7 times) it deleted the whole word in some 3 times...

however in the last 7 times it always went well.

@sspanak
Copy link
Owner

sspanak commented Nov 11, 2024

I don't think it is only you. I am experiencing the same problem when changing the language, but never with Backspace. Go figure! I'll see what I can do about it.

@maverick74
Copy link
Author

when changing the language

now that you mentioned it... i was previously in portuguese and changed language to english just before typing here the above message we talked about!

however, here, it is indeed in the backspace key afaict

@sspanak
Copy link
Owner

sspanak commented Nov 14, 2024

Just a slight change in the plan, I will probably not do it in this release, because I want to stay focused on adding support for East Asian languages. It really takes a lot of effort!

Meanwhile, I would like to confirm if it is a performance problem or a logic problem. Could you please remind me what your phone is? If I remember correctly it was a Redmi something...

The specs are one thing but it would be great if I can get a better idea of how fast your phone is. Are you using the "full" or the "lite" version? If you are using the "lite" version, do you mind installing the "full" one over it? You will not lose any data or settings, it will just take more storage space. After you are done testing, you can re-install "lite" over "full" to claim back that storage space.

If you are running the "full" version, I will need to know how long does a middle-sized language, for example Greek, take to load, provided that the screen does not go off while loading. To load only Greek:

  1. Go to Settings -> Languages -> Languages
  2. Disable all (you will not lose the words this way, no worries)
  3. Enable Greek
  4. Go back to Settings -> Languages
  5. "Load Selected"
  6. Note the loading time in the notifications.
  7. Go to Settings -> Languages -> Languages again
  8. Disable Greek and re-enable Portuguese, English and any others from before.
  9. Go back
  10. "Delete Unselected" to delete the Greek words.

If you were using the "lite" version re-install it to save some more storage space.

@maverick74
Copy link
Author

maverick74 commented Nov 14, 2024

It really takes a lot of effort!

No worries. It's all good :)

Could you please remind me what your phone is?

Xiaomi Redmi 5

Are you using the "full" or the "lite" version?

I use the lite version

how long does a middle-sized language, for example Greek, take to load

49,7s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants