Welcome, Guest. Please login or register.

Author Topic: AmiBrowser & broken JavaScript keyboard events  (Read 1331 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline broadblues

Re: AmiBrowser & broken JavaScript keyboard events
« on: February 19, 2026, 04:29:53 PM »
I've run a few tests, using https://en.key-test.ru/ and it looks like the key down value is wrong. This is masked by the fact t most things respond to key up. I'll look into it, thanks for the report.
 

Offline broadblues

Re: AmiBrowser & broken JavaScript keyboard events
« Reply #1 on: February 20, 2026, 11:22:23 AM »
Some more testing between your test page and the other more graphic one I've found reveals that this is down to passing through the native keycode as is.

I had a note in the code that this may be the wrong thing to do :-)

The curious thing is that the unmodified raw key worked up key up (on the key test ru page at least) I'm now thinking tt that i because it was out of range, so the code was falling back to the interpreted value, which passed separately.

The irony here  is that taws is probably converting this keycode back to an amiga rawkey code when it already is.

I've tried converting to linux input code, as it's running on linux backend CEF might expect that, and I have a convenient premade table for that for the linux builds of my MKShare tool,  but it appears not. That gives worse results!
 

Offline broadblues

Re: AmiBrowser & broken JavaScript keyboard events
« Reply #2 on: February 20, 2026, 05:04:37 PM »
This should be largely fixed in the ext update.
 

Offline broadblues

Re: AmiBrowser & broken JavaScript keyboard events
« Reply #3 on: February 24, 2026, 11:12:43 AM »

```
    NumPad9 reports as NumPad8        -  SHOULD BE IN NEXT RELEASE FIXED REVERSED CODE order in table
    NumPad8 reports as ScrollLock        - FIXED ditto
...

```
    F11 reports as Backslash                  - my test in cefclient shows correct hardware code in table,
    INSERT reports as MetaLeft             - my test in cefclient shows correct hardware code in table,
    HOME reports as MetaRight             -  my test in cefclient shows correct hardware code in table,
    END doesn't report at all
    PageUp reports as ScrollLock, too
    PageDown doesn't report at all
    ScrollLock doesn't report at all
    PRINT doesn't report at all
```

These are  more complex the codes in the table are correct based on the key events generated on the linux side, it may be there is some translation happening between the linux keyboard and the rawkey emitted inside the emulation.

My table originally mapped RawKeys (sent by MKShare from AmigaOS4) to linux uinput events, it's 99% accurate insofar as the correct key events occure on the linux side when an amigaos4 key is pressed. So I filled in the entries in reverse to create the newtranslation of rawkey to lowlevl hardware key.

I'll  have to add a extra debug layer to see what RawKey I get inside the AmiBench layer. Perhaps these spacial keys have been traslated by AmiBerry to look more like an amiga keyboard.

```
    CapsLock doesn't seem to invoke "OnKeyDown" and "OnKeyUp" but with every keypress, it switches between the two (while "OnKeyPress" being with "OnKeyDown")
```
I'll bet RawKey events are only being created on transitions of the key state here as it;s a locking key.. tempted to blame input device for that one (without hard evidence :-))

```
ESC closes the browser, even if event.preventDefault() is called (but I guess that's a bit of another issue)
```

This key is intercepted by MUI before it can be sent to the browser engine, it may r may not be possible to listen for that javascript call later on.
 

Offline broadblues

Re: AmiBrowser & broken JavaScript keyboard events
« Reply #4 on: February 24, 2026, 11:35:19 AM »
OK added a extra layer of debug:

  END doesn't report at all

Doesn't generate a RawKey event at all so that will be why.

    PageUp reports as ScrollLock, too
    PageDown doesn't report at all

I have this the other way round PAGEDOWN generates RawKey 95 (ie it's mapped to scroll lock AKA known as HELP in amiga keyboard context on OS4 atleast) PAGEUP emits no event

    ScrollLock doesn't report at all

Doesn't emit a rawkey event.

    PRINT doesn't report at all

Also no RawKey event,


F11 Is mapped to RawKey 13 (backslash)

HOME and INSERT are mapped to 102 103 ie Left and Rght Amiga.


So these "errors"  the result of the default keyboard emulation.

« Last Edit: February 24, 2026, 11:39:03 AM by broadblues »