tpmiddle-rs icon indicating copy to clipboard operation
tpmiddle-rs copied to clipboard

Middle button clicking not working as expected

Open eggbean opened this issue 1 year ago • 10 comments

After trying other things and looking everywhere for a solution, I was so happy to find this repository. The only problem is that it doesn't seem to work, so I am sad again now.

I've uninstalled the Lenovo driver and run this, but while the trackpoint-style scrolling works fine, the middle-clicking doesn't, so there is no apparent benefit over the Lenovo driver. Also, the Fn key unlock option doesn't seem to work.

I've got a ThinkPad Keyboard II for a new ThinkStation desktop PC. It's running Windows 10 at the moment, but I will be changing that to Windows 11. I'm also currently using the USB dongle connection, but I was originally planning on using Bluetooth once the Intel BE200 wifi/bluetooth card I ordered arrives.

I would use the dongle instead if tpmiddle-rs doesn't work with it and if I could get it to work with middle-clicking.

These are the options I am using: --fn-lock --sensitivity 9. I have also tried --no-fn-lock, but it makes no difference. However, this could be a problem with my current OS installation as I cannot get the function keys to work at all. They did work before I started trying different things to get this middle-clicking work.

Is the middle-clicking currently working for any other users of this tool?

eggbean avatar May 30 '24 01:05 eggbean

What version did you try? I forgot to release this v0.1.3 and left it for a long time. https://github.com/foriequal0/tpmiddle-rs/releases/tag/v0.1.3 Could you try this and see if it fixes?

I'm using a USB dongle due to BT interferences, and --fn-lock option, on Windows 11 (developed in Windows 10)

foriequal0 avatar May 30 '24 04:05 foriequal0

I was using v0.1.2, so I switched to v0.1.3 and it's the same 😢

I've realised that the Fn switch didn't appear to work as there were multiple processes. Everything seems to work other than the middle-click, which is of course the main function.

This is a pretty fresh, fully updated (normal channel) installation of Windows 10. I've tried different combinations of switches.

I will be changing to Windows 11 in the next couple of days so hopefully it will work with that. The only other difference that I can think of is that my keyboard has the UK ISO layout and yours probably does not.

Is there a way I can debug this?

eggbean avatar May 30 '24 22:05 eggbean

Can you try the master branch?

git clone https://github.com/foriequal0/tmiddle-rs.git
cd tpmiddle-rs
cargo run -- --fn-lock

foriequal0 avatar May 31 '24 05:05 foriequal0

Yes, the master branch works! 🥳

I assume the earlier versions used to work, so why don't they anymore? Windows Updates? And does this definitely not work with the Bluetooth connection? I will be installing the card soon, but I'm so glad I have this working now.

Another thing.. I installed Rustlang.Rust.GNU and Rustlang.Rust.MSVC using winget but the build failed on dependencies. I had to install Visual Studio Express with the "Desktop Development with C++" workload for it to install. How else can I get the required dependencies?

eggbean avatar Jun 01 '24 16:06 eggbean

I've been using it with the Bluetooth connection and pleased to find that it works fine.

I am now having a strange issue on a fresh installation of Windows, where double-clicking the executable doesn't run it as usual (the possible malware warning doesn't come up either) but a terminal window comes up instead and it stops running when the window is closed.

image

eggbean avatar Jun 06 '24 19:06 eggbean

I use rustup (https://rustup.rs/) to install Rust since it is officially recommended to manage Rust toolchains (https://www.rust-lang.org/learn/get-started) And as they noted, it seems inevitable to install "Desktop Development with C++" which can be installed with Visual Studio Installer. I installed it through "Visual Studio Build Tools" rather than full-blown Visual Studio.

A terminal window comes up and tpmiddle-rs stops working when the terminal window is closed since it is a console app. Windows mandates an ugly terminal window that cannot be hidden easily for a console app. A small vbs script (I know it isn't pretty) will hide the terminal window. put this tpmiddle-rs.vbs file alongside the tpmiddle-rs.exe, and launch this instead of the tpmiddle-rs.exe

set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
WshShell.CurrentDirectory = "<a path to tpmiddle-rs directory>"
WshShell.Run "tpmiddle-rs.exe --fn-lock", 0, False
Set WshShell = Nothing

foriequal0 avatar Jun 06 '24 19:06 foriequal0

It's been working great until recently. Some recent Windows 11 update (I am using the regular branch, not insider's builds) puts tpmiddle-rs into a suspended state, sometimes just after a couple of minutes after starting it.

Do you know of a way to stop it from being suspended? If not, I'm looking...

eggbean avatar Jul 25 '24 03:07 eggbean

That's weird. I'm using Win 11 too but it hasn't happened for me.

foriequal0 avatar Jul 25 '24 03:07 foriequal0

It started happening around the same time on both my new ThinkStation with ThinkPad Keyboard II where I use tpmiddle-rs and my ThinkPad T480s (Elan trackpoint) where I use marblescroll.exe for the same thing and the issue with the processes going into Efficiency Mode results in the same problem. I haven't yet tried my older T460s with Synaptic trackpoint where I use the classic tpmiddle.exe, so I don't know if the same occurs with that.

Because they happened around the same time, I assumed it must be a Windows Update, but I cannot see any recent update which mentions anything about this.

However this has happened (I will find out eventually), I seem to have fixed the issue by using Process Lasso, which has the ability to disable Efficiency Mode for specific processes. I also use its ability to restrict only one running process for tpmiddle-rs and marblescroll.exe, because I thought I might as well.

I'm not sure if the paid-for Pro version is required to run it as a service - when the trial runs out I will know. If I have to buy it, I'll get the lifetime multi-machine licence, which isn't cheap, but it looks like a pretty good program and will probably be useful for other things.

eggbean avatar Jul 30 '24 02:07 eggbean

I've seen a might-be-related feature in MSDN:

By default in Windows 11 if a window owning process becomes fully occluded, minimized, or otherwise non-visible to the end user, and non-audible, Windows may automatically ignore the timer resolution request and thus does not guarantee a higher resolution than the default system resolution. https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setprocessinformation

But Efficiency Mode (EcoQoS Mode) is enabled if and only both PROCESS_POWER_THROTTLING_EXECUTION_SPEED for SetProcessInformation and IDLE_PRIORITY_CLASS for SetPriorityClass are set when I tested.

foriequal0 avatar Jul 30 '24 02:07 foriequal0