Author Topic: PgUp and PgDn not working  (Read 4588 times)

mads

  • Newbie
  • *
  • Posts: 4
    • View Profile
PgUp and PgDn not working
« on: June 09, 2018, 08:41:10 am »
Cant get PgUp/PgDn to work (should be Fn+Arrow up/down) with norwegian gemini keyboard. Tested it out in Chrome and JuiceSSH...

Is there something I do wrong? Have anyone got these keys working?

leviathan3k

  • Newbie
  • *
  • Posts: 3
    • View Profile
PgUp and PgDn not working
« Reply #1 on: June 09, 2018, 05:44:25 pm »
I'm actually having the same problem with an English keyboard. So definitely wondering if anyone has an answer.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
PgUp and PgDn not working
« Reply #2 on: June 09, 2018, 08:10:49 pm »
Quote from: leviathan3k
I'm actually having the same problem with an English keyboard. So definitely wondering if anyone has an answer.
There is another thread about this somewhere.....The page up and page down keys work fine, it is android which doesn't universally understand them. The app in question needs to support page up and down. I use Textmaker for my word processor and it quite happily uses page up, down, home and end. Android was designed for a phone, which by definition doesn't have page up and page down. The keyboard was optimised for on screen and word correction. It is a pain to program for because it uses non standard key events.

A program which wants page up/down (eg word processor) will listen for the key codes and use them. Most android apps don't.

leviathan3k

  • Newbie
  • *
  • Posts: 3
    • View Profile
PgUp and PgDn not working
« Reply #3 on: June 09, 2018, 11:54:28 pm »
Quote from: vader
Quote from: leviathan3k
I'm actually having the same problem with an English keyboard. So definitely wondering if anyone has an answer.
There is another thread about this somewhere.....The page up and page down keys work fine, it is android which doesn't universally understand them. The app in question needs to support page up and down. I use Textmaker for my word processor and it quite happily uses page up, down, home and end. Android was designed for a phone, which by definition doesn't have page up and page down. The keyboard was optimised for on screen and word correction. It is a pain to program for because it uses non standard key events.

A program which wants page up/down (eg word processor) will listen for the key codes and use them. Most android apps don't.

Nope, wasn't that. I have another Android device, and I use a Twiddler with it. Twiddlers have pgup/pgdn, and the apps I use on my phone explicitly support it.

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
PgUp and PgDn not working
« Reply #4 on: June 10, 2018, 03:18:52 am »
Quote from: leviathan3k
Nope, wasn't that. I have another Android device, and I use a Twiddler with it. Twiddlers have pgup/pgdn, and the apps I use on my phone explicitly support it.
Install textmaker and try the page up/down/end/home buttons. If they don't work there, then something is wrong.

leviathan3k

  • Newbie
  • *
  • Posts: 3
    • View Profile
PgUp and PgDn not working
« Reply #5 on: June 10, 2018, 07:17:28 am »
..Okay, this is making very little sense.

On my oneplus with a keyboard:

These keys work in Textmaker, and in bVNC and Jump Desktop.

On the Gemini:

These keys only work in Textmaker.

What the heck is going on here?

vader

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
PgUp and PgDn not working
« Reply #6 on: June 10, 2018, 09:58:06 pm »
Quote from: leviathan3k
..Okay, this is making very little sense.

On my oneplus with a keyboard:

These keys work in Textmaker, and in bVNC and Jump Desktop.

On the Gemini:

These keys only work in Textmaker.

What the heck is going on here?

OK, so I actually checked this out properly. The up arrow gives a key code of 19. The physical page up key (if your keyboard has one) is 92. When the gemini has the fn button pressed it adds a meta value of 8. The meta determines if other keys are down, eg. shift ctrl etc. So we get the following:

Up arrow => code = 19, meta = 0
Page up => code = 19, meta = 8

This is correct. Now there are two ways to get page up - the physical page up key (92) or a meta key (fn + 19). When people code key event listeners in android, they normally get a bit lazy and use functions like isShiftPressed() instead of checking the meta value. Text maker appears to correctly check the meta value of the key press to determine what key is pressed. This is how most desktop applications would do keyboard input if they are listening to the events. This correctly identifies page up. Android apps which go the lazy way just make use of a few built in functions. They will detect fn + 19 as just 19 as they don't have a function for fn (meta value 8). Remember that normally, android has a soft keyboard and no real need for page up/down etc.

Now saying this, the gemini keyboard app is managing a few other keys, so it should possibly translate fn + 19 to 92, but it doesn't seem to. The problem about doing this is that apps which correctly look at the meta value might break. They would detect fn + 92  rather than fn + 19.

Anyway, this is why the page up/down/end/home only work in some apps. Those apps which correctly look at meta values will work, those that don't won't.

mads

  • Newbie
  • *
  • Posts: 4
    • View Profile
PgUp and PgDn not working
« Reply #7 on: June 12, 2018, 06:46:37 am »
Cool that you figured that out!

I hope the gemini keyboard app will be updated to convert those meta values, or provide the option to do so...

gidds

  • Sr. Member
  • ****
  • Posts: 324
    • View Profile
PgUp and PgDn not working
« Reply #8 on: June 13, 2018, 10:44:02 am »
Should we be emailing app authors and asking them to support more keycodes?

(Jota+ is the one that bugs me most so far.)
   Andy/
Psion 3a → Psion 5 → Psion 5mx → Gemini → Astro

zevv

  • Newbie
  • *
  • Posts: 48
    • View Profile
PgUp and PgDn not working
« Reply #9 on: July 24, 2018, 12:49:26 pm »
I just fixed this in Termux and submitted a pull request to upstream. Now we wait.

For the impatient, the brave and the testers, here is a debug build: http://zevv.nl/div/termux-gemini-debug.apk