Recent

Author Topic: MouseAndKeyInput on Linux64 --SOLVED--  (Read 4553 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2280
    • tomboy-ng, a rewrite of the classic Tomboy
Re: MouseAndKeyInput on Linux64 --SOLVED--
« Reply #15 on: October 22, 2022, 11:45:51 am »
OK, think I know why this issue has not been fixed. I have tested 13 distros from my test suite, only one showed the fault that is plaguing desliem !

I tested  MXLinux193KDE, Linux Mint 20.2, Linux Mint LMDE5, Manjaro21.2, Debian Bullseye Mate, Debian Bullseye KDE, Ubuntu 22.10 Gnome, Ubuntu 22.04 Gnome, Ubuntu 21.04 Gnome, Ubuntu 20.04 Mate, Ubuntu 18.04 and OpenSuse LEAP 15.4 and they all worked flawlessly.

I was wondering if the problem relates the where it was built rather than where it was run but noticed that desliem was using a relatively old Linux Mint, so I went for my oldest VM, Ubuntu 16 and that behaved just as desliem described - badly.

Wow.

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng

desliem

  • New Member
  • *
  • Posts: 11
Re: MouseAndKeyInput on Linux64 --SOLVED--
« Reply #16 on: October 22, 2022, 06:35:08 pm »
I have tested 13 distros from my test suite, only one showed the fault that is plaguing desliem !

Amazing amount of work by dbannon. Thank you very much.

Your research explains why the bug has been so rarely reported. I'll be much more circumspect about the need to edit XKeyInput in my GitHub project that uses the lazmouseandkeyinput package.

Just fixing it by replacing the boolean ? The devs, quite rightly, like to understand the issue before acting. When playing with compilers and libraries, the side effect can be very off to one side and not show up until much later.

Must agree with dbannon, of course. It also strikes me that my "explanation" for the need to use a longbool type doesn't really make sense. After all KeyUp with the letter B (and most other keys, including O which the OP reported on) works with the is_press type being boolean on my system.

Looking at it from another perspective, the current code for XTestFakeKeyEvent (https://gitlab.freedesktop.org/xorg/lib/libxtst/-/blob/master/src/XTest.c) is
Code: C  [Select][+][-]
  1. int XTestFakeKeyEvent(Display *dpy, unsigned int keycode, Bool is_press, unsigned long delay) {...

What is the size of Bool? I found this in XLib.h (https://code.woboq.org/gtk/include/X11/Xlib.h.html)
Code: C  [Select][+][-]
  1. #define Bool int

My very limited understanding of C/C++ is that int is not a fixed size, but depends on the implementation. However int and unsigned int are usually the same size. Since the keycode type in the Pascal declaration is dword (32 bits), would it not make sense to declare is_press as a 32 bit boolean also?

My head hurts, all this is very much above my pay scale.

I'll reference dbannon's previous message in the bug report, for the very reason quoted above.

By the way, did anyone else notice the memory leaks?
« Last Edit: October 22, 2022, 07:08:06 pm by desliem »

 

TinyPortal © 2005-2018