flutter-tizen / embedder

Flutter embedder for Tizen
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

Key events when keep pressing an arrow key #14

Open WonyoungChoi opened 2 years ago

WonyoungChoi commented 2 years ago

When keep pressing an arrow key (up, down, left, right) of keyboard, the key event seems to occur only once.

Repro

  1. In any TextField, type any characters
  2. Keep pressing an arrow key to move cursor continuously.
  3. But, the cursor moves single step.

Expected The cursor should be moved continuously like typing any other characters.

This isn't limited to TextField, it happens in general, like moving a Widget's focus.

Environment

swift-kim commented 2 years ago

I can't reproduce the problem. We're already taking repeated key events into account.

Which device did you use?

WonyoungChoi commented 2 years ago

RPI4 34bit :(

HakkyuKim commented 2 years ago

Some keys (return, arrow keys, numbers, etc) do not constantly generate ECORE_EVENT_KEY_DOWN event. https://github.com/flutter-tizen/engine/blob/06ddbce069b64d4e5471665eceb36292bb38cb8f/shell/platform/tizen/tizen_window_ecore_wl2.cc#L314-L336

Maybe there's an API that can change which keys should be keep generating ECORE_EVENT_KEY_DOWN events?

HakkyuKim commented 2 years ago

To share findings so far, ecore_wayland module listens a single keyboard press down event and determines if it should generate repeating ECORE_EVENT_KEY_DOWN events. The module determines this internally by calling xkb_keymap_key_repeats which returns whether the given key should be repeated or not (https://github.com/xkbcommon/libxkbcommon/blob/57af9cb71f19f37394399b549f7cb7b0d9fe3988/include/xkbcommon/xkbcommon.h#L1263-L1279).