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

OnKeyDown event triggered twice #4

Closed
invy opened this issue Aug 19, 2016 · 15 comments
Closed

OnKeyDown event triggered twice #4

invy opened this issue Aug 19, 2016 · 15 comments
Assignees

Comments

@invy
Copy link
Contributor

invy commented Aug 19, 2016

OnKeyDown event is triggered twice, which causes cursor to jump over files and menu entries.

OnKeyDown: 0 13d
OnKeyDown: 0 13d
OnChar: 0 13d
OnKeyUp: 0 13d
OnKeyDown: 0 13d
OnKeyDown: 0 13d
OnChar: 0 13d
OnKeyUp: 0 13d
OnKeyDown: 0 13b
OnKeyDown: 0 13b
OnChar: 0 13b
OnKeyUp: 0 13b
OnKeyDown: 0 13b
OnKeyDown: 0 13b
OnChar: 0 13b
OnKeyUp: 0 13b

and so on.

@invy
Copy link
Contributor Author

invy commented Aug 19, 2016

Ubuntu 16.04
Gnome 3.18.5
wxwidgets version: 3.0.2+dfsg-1.3

ldd far2l
linux-vdso.so.1 => (0x00007fff18ff2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0515d20000)
libwx_gtk2u_core-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0 (0x00007f05154a7000)
libwx_baseu-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libwx_baseu-3.0.so.0 (0x00007f0515014000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0514c92000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0514989000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0514772000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0514555000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f051418c000)
/lib64/ld-linux-x86-64.so.2 (0x0000560aac661000)
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f0513b40000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f051388b000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f051367e000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f0513369000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f0513147000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f0512efb000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f0512ca7000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f0512996000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f051265c000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f0512455000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f051224d000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f0512028000)
libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f0511dce000)
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f0511b5b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0511941000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f051173c000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f0511536000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f0511310000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f0510f88000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f0510d72000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f0510b2e000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f0510924000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f0510720000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f0510510000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f0510305000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f05100fb000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f050fef7000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f050fcf4000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f050fae2000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f050f837000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f050f58f000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f050f38a000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f050f180000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f050ef5e000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f050ed55000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f050eb4c000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f050e943000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f050e6d3000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f050e4b9000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f050e2b3000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f050e091000)
libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f050de83000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f050dc60000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f050da45000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f050d7e6000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f050d5bd000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f050d3b8000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f050d1b2000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f050cfaa000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f050cd84000

@elfmz
Copy link
Owner

elfmz commented Aug 19, 2016

interesting that i'm using approx same config without any problems) anyway I've commited some blind fix - please check if it improved situation..

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

Nope, it didn't solve the problem.

OnKeyDown: 0 13d 0
OnKeyDown: 0 13d 0
OnChar: 0 13d 0
OnKeyUp: 0 13d 0
OnKeyDown: 0 13b 0
OnKeyDown: 0 13b 0
OnChar: 0 13b 0
OnKeyUp: 0 13b 0

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

please add event.GetTimestamp() and see if duplicate keydowns have it same or not:

void WinPortPanel::OnKeyDown( wxKeyEvent& event )
{
        fprintf(stderr, "OnKeyDown: %x %x %u %lu\n",
                event.GetUnicodeKey(), event.GetKeyCode(), event.GetSkipped(), event.GetTimestamp());

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

OnKeyDown: 0 13b 0 27936778
OnKeyDown: 0 13b 0 27936778
OnChar: 0 13b 0
OnKeyUp: 0 13b 0
OnKeyDown: 0 13d 0 27937214
OnKeyDown: 0 13d 0 27937214
OnChar: 0 13d 0
OnKeyUp: 0 13d 0

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

check now

@elfmz elfmz self-assigned this Aug 20, 2016
@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

Well, the cursor of course is not jumping over items now, that's an improvement. However every other key (enter, esc, letters) is now needed to be pressed twice to have an effect.

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

Funny, curse of double-ESC from ncurses reached me :)
So I want to see output from other keys too. Did they work correctly before this change however?

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

The alpha-numerical input worked fine (I think, because it's being taken from OnChar event), escape and enter also did work fine. Only the arrow keys were problematic.

Here is trace of last lifecycle:
far2l_lc.txt

It's also interesting, that it's not every time I need to press esc/enter twice. The numpad enter works fine from the the start on, until I press 'normal' enter.

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

I've made further investigation. It seams, that the described behavior somehow depends on profile settings. (I've created another and tested far2l, there were no double OnKeyDown events).

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

may be you have some software that may interfere with keyboard input? Or some gnome extension.

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

Well here is a minor breakthrough. The only software I could think of, which could interfere with the input was ibus. A wild guess of killing ibus-x11 process running from my user gave positive results. I receive no more duplicate events.

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

I'm also have IBus and Russian/English layout and no repro
However I've just did another change there, check it please..

@invy
Copy link
Contributor Author

invy commented Aug 20, 2016

The last fix seams to fix the problem.

@elfmz
Copy link
Owner

elfmz commented Aug 20, 2016

closing

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