[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIDGET_DRAW wheel events are not quite right. #1707

Open
jtappin opened this issue Jan 2, 2024 · 5 comments
Open

WIDGET_DRAW wheel events are not quite right. #1707

jtappin opened this issue Jan 2, 2024 · 5 comments

Comments

@jtappin
Copy link
jtappin commented Jan 2, 2024

I've uncovered a few rather odd behaviours in GDL relating to wheel events and widget_draw (plus one in IDL that is dead wrong).

Test code (include /wheel' in the options for this issue e.g. motion_test, /but, /wheel` motion_test.pro

  1. The first wheel event seems to be lost. Bring the cursor over the window and turn the wheel one click: nothing happens. Subsequent wheel events are recorded.
  2. The number of clicks is recorded as +/- 120 rather than +/- 1

In addition in the case of devices with an x-scroll by clicking the wheel sideways, GDL produces a wheel event indistinguishable from the normal wheel event, whereas IDL produces a pair of button click events apparently coming from button 1. I think that in this case we ought to leave the status quo as IDL's behaviour looks more wrong than GDL's.

@jtappin
Copy link
Author
jtappin commented Jan 3, 2024

I should add that there are also differences in the handling of keyboard events (same code can be used to test, ).

For an alphabetic key:
In GDL the CH field of the event structure always contains the code for the UPPERCASE letter.
In IDL the CH field contains the ASCII code of the modified letter, e.g. for 'a', 97 without mods or with alt, 65 with shift and 1 with control.

For the number row
In GDL the code for the number is always returned, e.g. entering $ on a UK keyboard gives CH=52.
In IDL the code for the symbol is returned -- though there are some issues as IDL doesn't cope with for example the £ symbol.

Function keys
In GDL the code for the first part of the string sent is returned (e.g. F9 returns CH=92)
In IDL they are ignored entirely as the documentation claims.

I'm still a bit confused with the keypad.
With num lock off: the arrows seem to do what they should and sent a type=6 event, but the others seem to be like the function keys.
With num lock on: the numbers return the letters E-M, while the other keys continue to return odd codes, not the same as the codes returned for the same symbols on the top row.

@GillesDuvert
Copy link
Contributor

Many thanks, @jtappin . Well noted!

@GillesDuvert
Copy link
Contributor
GillesDuvert commented Feb 8, 2024

I've uncovered a few rather odd behaviours in GDL relating to wheel events and widget_draw (plus one in IDL that is dead wrong).

Test code (include /wheel' in the options for this issue e.g. motion_test, /but, /wheel` motion_test.pro

1. The first wheel event seems to be lost. Bring the cursor over the window and turn the wheel one click: nothing happens. Subsequent wheel events are recorded.

hm... seems to be a problem inside wxWidgets...

2. The number of clicks is recorded as +/- 120 rather than +/- 1

OK.

In addition in the case of devices with an x-scroll by clicking the wheel sideways, GDL produces a wheel event indistinguishable from the normal wheel event, whereas IDL produces a pair of button click events apparently coming from button 1.
According to documentation, wheel events exist only under Windows, although indeed they are reported under linux.

X or Y wheels are also simuled by a trackpad. on my trackpagd, IDL does not see X "wheel" events, whereas GDL does.

@jtappin
Copy link
Author
jtappin commented Feb 12, 2024

I do suspect that many of the stranger widget issues are related to IDL continuing to use the ancient Motif toolkit for Linux, and that simply doesn't support many of the newer types of input device.

@GillesDuvert
Copy link
Contributor

@jtappin I'm not sure we should mimic IDL with the number of clicks always 1 or -1. With my wheel I get +/-120 but with the trackpad scrolling (old trackpad, the right and bottom part of the trackpad on a small area can be used as a virtual "slider") these values change with the scrolling speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants