raizal / shortyz

Automatically exported from code.google.com/p/shortyz
0 stars 0 forks source link

Letter 'p' entered randomly when using Galaxy Note Stylus and built-in keyboard selected #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- Samsung Galaxy Note
- Stylus in use
- Built-in keyboard active (as opposed to the native one)

Frequently when the stylus taps the screen, a letter 'p' will be input into the 
puzzle. This happens about 10% of the the time when tapping a cell, and almost 
all the time when taping a letter on the keyboard. Often two p's are inserted. 
It also occurs when tapping the status bar (not in full screen mode).

When this happens the key preview above the letter 'p' on the keyboard does not 
display. It does not appear like a false contact with the letter 'p' is being 
registered.

Everything works normally for finger input or when the native keyboard is 
selected.

Original issue reported on code.google.com by mrmik...@gmail.com on 8 Feb 2012 at 5:32

GoogleCodeExporter commented 9 years ago
I got Shortyz running on my phone with the debugger attached and found a fix to 
this bug.

In PlayActivity.onKeyUp for a normal 'P' form the keyboard this is the KeyEvent 
data:
    KeyEvent{action=0 code=112 repeat=0 meta=0 scancode=0 mFlags=6}

When the S-Pen stylus contacts the screen this event is sent:
    KeyEvent{action=1 code=112 repeat=0 meta=0 scancode=544 mFlags=8}

Shortyz needs to ignore this but I'm not sure what combination of action/mFlags 
is best to use to filter out this event. The following works, but I'm not sure 
it will work on a device with a physical keyboard. I don't have one to test 
with.

For near the end of the PlayActivity.onKeyUp method:

    if (ALPHA.indexOf(c) != -1) {
        if ((event.getFlags() & KeyEvent.FLAG_SOFT_KEYBOARD) == KeyEvent.FLAG_SOFT_KEYBOARD) {
            previous = BOARD.playLetter(c);
            this.render(previous);

            return true;
        }
    }

Original comment by mrmik...@gmail.com on 22 Feb 2012 at 7:28

GoogleCodeExporter commented 9 years ago
For a temp workaround, the P will not be entered If you deselect XT9 on your 
keyboard options.

Also for the Note, it appears as if the Pen input registers slightly to the 
right of where you tap the screen.

Original comment by jmhar...@gmail.com on 5 Jul 2012 at 11:07

GoogleCodeExporter commented 9 years ago
I also get the random 'P' character on my Droid X when I accidentally press the 
camera button on the side of the phone, which happens fairly regularly because 
of the button's position.

Original comment by oston...@gmail.com on 12 Sep 2012 at 2:33