Jump to content

Duplicated keys


Recommended Posts

Hey y'all. I've seen some references to weird input issues in the forum, but none seem to match the issue I've been having. For the past months, I've been getting phantom repeated inputs on the keyboard. I'm typing away, and some letters appear twice (and sometimes the clicks don't register at all).

I definitely did not have this issue with the stock firmware, and I believe I didn't either when I originally migrated to LineageOS 18.1, but this has been going on for a few months and it's really getting on my nerves (I've been trying to ignore it, since it takes me many many hours to do a reflash and restore my settings, and this is my daily driver).

I've tried turning "Fast poll" off and on, with no difference, and I'm running the latest 18.1 build, from 14 of June, but I've had this issue for many builds.

Does this happen to anyone else?

  • Sad 1
Link to post
Share on other sites

I suspect it is the same problem that makes the pop-up for alternate characters happen.  The keys seem to have a very short time-until-repeat interval. If you delay how long you dwell on a key, it will repeat.  There is no setting for this in Lineage and don't remember if there was in stock or if the default interval was longer. As far as I recall, this has been happening since Lineage 16, so maybe your keys are getting stickier in their response for some reason?

To be clear, I am not experiencing troubles with this, but it took me  while to train my fingers.  Since you were not experiencing this at first, I am wondering if something may be happening with your keyboard.

Edited by Hook
Link to post
Share on other sites

I've had the same issue, at times excessively. Ghost input was an issue as well.

For me it was solved temporarily by updating the system OS (in my case LineageOS). Im think updating to Android 11 (?) solved it mostly, I only had these issues rarely again.

 

It seems to be related to software load: the system is under load (i.e. some background process) and the keyboard recognition is stopped temporarily. When it starts again it checks for the time passed and believes that you pressed the key twice or longer. I was interested to prioritize the keyboard process above everything else but I don't know where to start.

What I can say is that Android 11 seems to handle this much better. I can also imagine that wiping Dalvik cache could help, but you'd need a recovery manager like TWRP for it.

 

Edit: the reason I could imagine wiping Dalvik cache solves it is that it gets worse over time but works fine after any update, even if it's another Nightly of the same LOS/Android version.

Edited by SchattengestaIt
  • Thanks 1
Link to post
Share on other sites

No luck! I did a complete nuke this weekend: factory reset, then flash via adb, and I still get repeated keys.


Damn. I'm trying to resurrect my Blackberry Priv so that I can use it temporarily, and once I do, I'll try flashing back to stock and see if the issue still happens there (and thus is hardware) or not (and thus is LineageOS issue).

  • Sad 1
Link to post
Share on other sites

Yeah. It's just such a shame that 18-ish years ago I could nuke my Palm Zire 71, do whatever experiments I wanted, and then put it on the cradle, press a button, and everything would be recovered.

Android is still a mess of some apps that restore their configs, some that don't, etc. Just awful.

  • Like 3
Link to post
Share on other sites

As far as I know, with my first Pro1 I had this issue with LOS16 and qwerz keyboard. If I remember correctly, @tdm solved this issue and I had it but very very rarely.
Since I've a new one, (qwerty keyboard with LOS17) I never see this issue. But I plan to complete wipe data and flash LOS18.

Do you have a qwertz or a qwerty keyboard ?

Link to post
Share on other sites
On 6/27/2021 at 2:43 PM, ivoanjo said:

I have a qwerty keyboard

The hardware of the qwertY and the qwertZ models is identical, except the print on the keys.
The software handles qwertY as the default. When qwertZ is selected by the user, the keys are remapped.

Link to post
Share on other sites

I also have been experiencing this for a while now. I'm on some version of AICP Q, haven't wiped, updated or done any changes to the system since I flashed AICP like Christmas or so. Before flashing AICP, I had random keys appearing quite frequently, but this bug almost completely disappeared when I flashed AICP. This NEW issue, with sometimes no character input on keypress, and sometimes double or triple character input on single keypress, is something else. My guess is that the device - or at least the keyboard part of it - is just getting old. Something in the keyboard has worn out, and this results as dysfunctioning key buttons. This makes me sad, as I would have hoped for much longer lifespan for this device.

  • Sad 1
Link to post
Share on other sites
  • 2 weeks later...

This has been a maddening problem since my Photon Q, and I believe there are 2 issues happening, and although I'm a talented engineer, I'm not in a position to confirm my suspicions in the near future.  I believe auvo.salmi is right, in that the keyboard is wearing out a bit over time.  This causes noise or "bounces" in the keyboard input.  In the best-case scenario of keyboard design and OS integration, there is a dedicated microcontroller reading the mechanical buttons which employs advanced debounce algorithms.  In my microcontroller programming experience, I require about 60ms of no keypress input before processing another keypress - any input after a valid keypress is null and void if 60ms doesn't go by with no more activity.  Because this phone's keyboard hardware is not much more than a serial to parallel port expander, it is up to the OS to employ proper button debouncing.  I suspect that there is not a proper debouncing routine operating at a very high priority, such that it scans the keyboard every 1 to 5 ms and employs proper debouncing for each key.  I also suspect that keyboard input is being handled out of order on occasion, since at times, when I'm typing very fast, the letter Before the last letter I type gets repeated.  I believe that a new high-priority keyboard debouncing routine needs to be created in the OS kernel, at the lowest level.  If said routine does not scan the keyboard every 1 to 5 ms and get rid of bouncing noise, there is no way to determine if a key was pressed once, or twice very, very fast.  I also believe every registered keypress should be time-stamped so that any errors can be eliminated after the fact.  Anyone out there qualified to look into this?  It's pretty insane that this problem has been part of the Android OS since 2012.  And can anyone explain why my 2010 Samsung Moment (SPH-M900) had the most flawless typing of any device from then until now, that I know of??  The brilliant raised border around the keys kept your fingers from hitting an adjacent key accidentally, but I never once had a repeat issue.  Did they use a dedicated keyboard microcontroller with it's own debouncing, as I suspect?  If so that would explain a lot.

  • Thanks 2
Link to post
Share on other sites
On 7/13/2021 at 1:17 PM, ivoanjo said:

I've sent my Pro1 for repair last saturday, I'll update here if the issue got fixed once I get it back and am able to check.

I wish you the best luck, but I suspect their fix will likely be either a new motherboard with nice, new, shiny, clean keys that don't produce enough noise to mess up (for a little while), or it will come back the same.  The only proper fix is in the Android kernel, but since nobody cares about a phone with a physical keyboard anymore (except for us few enlightened souls), I'm really not sure it will ever happen.  It's not a matter of rewriting the existing keyboard handling code, it's probably a restructuring problem, so the keyboard handling is a much higher priority, and ensuring processing is not done out of order (could this be an artifact of spell-check???).  I think these are a couple things that could possibly explain getting a repeat of the key Before the last key pressed, not just a repeat of the last key, which could be a simple debouncing issue.  Or is it a buffer issue, where keys are getting stored and read repeatedly or out of order because flags and variables are not updating as fast as the keys are stored and read?  I really wish I could tackle this problem myself, sorry guys.  I just hope my thoughts inspire someone to look into this.

Link to post
Share on other sites

For what it's worth, I never had such issues that I can remember for all of last year. That's why I suspected it may be some new bug on LineageOS, but once I flashed to stock and saw the issues I was pretty much convinced it was a hardware problem.

If there were such issues when I got the phone in early 2020, I would've immediately sent it back.

Link to post
Share on other sites
9 hours ago, ivoanjo said:

For what it's worth, I never had such issues that I can remember for all of last year. That's why I suspected it may be some new bug on LineageOS, but once I flashed to stock and saw the issues I was pretty much convinced it was a hardware problem.

If there were such issues when I got the phone in early 2020, I would've immediately sent it back.

It is partly a hardware issue that should be flawlessly corrected with proper software, as I've described.  My repeated key issues started about 9 months ago.  Same thing with my Photon Q.  I'm surprised the backspace key didn't break off and fall right out of the phone.

That's very interesting that it's happening on LineageOS as well.  But I'd have to guess that the way keyboard input is processed on LineageOS was just "borrowed" from Android.

I'm an old-school microcontroller coder, and I have an example of this happening in early 80's tech.  I have an old Radio Shack programmable clock that controls 2 AC outlets on the back.  Being that it's 40 years old, the insides of the buttons have acquired dust, dirt, debris, film, residue, whatever.  When the clock was new, it worked flawlessly.  If it didn't people would have returned them, as we all would have with our Pro1 phones.  The engineers that created the clock were developing the code with new buttons that had a nice clean output.  They were unaware of how the hardware degrades over time, so they didn't employ a proper debouncing algorithm.  Over time the buttons degraded and setting the correct time became a nightmare due to the keys repeating so badly.

Back in the 90's, I attended a seminar by engineer guru Steve Ciarcia.  We specifically spoke about button debouncing afterwards.  Although I haven't yet employed his exact version, he described an algorithm that actually has a counter assigned to each key.  Say you have an 8-bit counter assigned to every key that counts from 0 to 255 with no roll-over.  Every millisecond, the routine scans the keyboard and each counter increments by a significant amount like 64 or 128 when the key is pressed, and decrements by a small amount like 3 or 4 when not pressed.  When the counter is maxed out, you have a valid keypress, but it can't output a second keypress until the counter returns to zero.

What happens in the middle is what we're talking about here.  With a brand new keyboard, when a key is pressed, its counter will go up quickly and just hold at 255, waiting for the key to be released.  When the key is released, the counter just counts back down to zero, and it's ready to register another keypress when it occurs.  However with a degraded keyboard, a keypress is not a constant state.  When the key is held down, pressure, angle of the keypress, etc. causes the contact point inside the button to shift slightly, and as I said, there's dirt, residue, etc, interrupting the contacts.  So when the key is held down, the output is pure chaotic noise, randomly outputting pure digital crap, not just a nice 1 or 0 when the button is held or not held.  The above algorithm has the effect of never letting each key's counter return to 0 and reset until the finger is actually off the key and all the noise has stopped for a good 60 milliseconds, at least.

It seems this is not happening in either OS.  If it was, having this problem would be physically impossible, unless it's a coding structure thing like I said before and valid keypresses are being interpreted multiple times later down the line.  But because it seems only us that have older devices are experiencing this problem, someone really needs to look into the keyboard debouncing, or lack thereof, on both Lineage and Android.  Hope this inspires someone to poke around a bit.

  • Like 2
  • Thanks 1
Link to post
Share on other sites
  • 1 month later...
On 7/3/2021 at 4:31 PM, ivoanjo said:

I think you may be right @auvo.salmi. I flashed back to stock, and no dice -- same problem.

I'll see if I can send it in for repairs. Indeed like many here I was hoping that my Pro1 would last for a few years, but...

Funny thing is that on my device this problem fluctuates. Sometimes the keyboard works just normally without duplicated keys, and sometimes typing is annoying as hell. But perhaps not a hardware issue on my device after all.

Link to post
Share on other sites

Lately, once in a while I get two 'e' characters instead of one, which definitely looks like the result of wear.

I still hope that one day we'll get those replacement keyboards Fxtec originally hoped to be able to offer at some point, which seem to be easy enough to replace at home... We'd also be able to exchange a QWERTY keyboard for a QWERTZ then, or vice versa, or a shifted QWERTY for a non-shifted QWERTY...

  • Like 2
Link to post
Share on other sites

Same issue here. double "e", sometime no "d" or "a" and now and then the keyboard lags (words displaying on screen 3 to 4 words behind what I'm typing).

I had the lag issue on my Nokia E7 a couple of months before switching to a BB Priv, so after about 3 years of use.

Really a shame since typing turned from fun to annoying.

Both issues described above not happening constantly, so this makes me think they are both software issues.

I monitored CPU usage for a bit, but as of now, I couldn't pinpoint an app that bottlenecks the CPU.

  • Thanks 1
  • Sad 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms