oddbear / Loupedeck.Companion.Plugin

Bitfocus Companion Plugin (unofficial) for the Loupedeck interface.
MIT License
6 stars 0 forks source link

No response to button presses #3

Open Aleksrayx opened 1 year ago

Aleksrayx commented 1 year ago

Hallo, I have a problem with button clicks when the app Loupdeck is minimized. If the app Loupdeck on focus, Companion it reacts to pressing the buttons on, but when the app Loupdeck is not in focus or minimized, there is no reaction. However, if I click buttons in the Companion`s emulator, then there is always a reaction on Loupdeck device. What could be the problem? Firmware version: 0.2.8 Software version: 5.6.2.16258 Companion version: 2.4.2

Aleksrayx commented 1 year ago

I am fixed it. You need to use "if (touchEvent.IsPress())" and "if (touchEvent.IsTouchUp())" in overrided function "ProcessTouchEvent" instead of "switch (touchEvent.EventType)". Take this complied plugin if some one needed, just put in to the C:\Users\USERNAME\AppData\Local\Loupedeck\Plugins\ folder

oddbear commented 1 year ago

This is interesting, thanks for reporting... and doing some research.

I am not able to reproduce this, and it seems very strange. Since this touches the Loupedeck plugin internals, and that code is obfuscated, I will ask the Loupedeck team what's going on.

I also see that you are using an older version of the plugin, since the latest does have override on RunCommand (this is needed to use actions in macros), and that was missing from your compiled plugin.

Do you have the same problem with the newest version?

oddbear commented 1 year ago

Could this be because of the EventType?

It seems like if I have a LongPress, the current code does not work as I would have expected.

Aleksrayx commented 1 year ago

I used the current version of the plugin, just commented out the RunCommand. From the Companion logs, I understood that when the application is not in focus, only the Release command comes, but Press is absent, this is only relevant for a dynamic folder. If we select a static button, we will receipve 1 Press and 2 Release requests and this work, but no feedback on button screen. I can't understanded the dependencies of being in focus, I analyze the work of the plugin in debuger.

Aleksrayx commented 1 year ago

I am not able to reproduce this, and it seems very

May be because i am use razer stream controller. But, as far as I know it's the same. If you need help testing the plugin on my device, I'm here to help.

oddbear commented 1 year ago

I was not testing it in folders. So now I where able to reproduce the issue. Nice.

A strange one this, and not sure if this is a Loupedeck issue or a plugin issue. I will investigate to see what I find, but I will be traveling from tomorrow, so probably no release until after the weekend.

Aleksrayx commented 1 year ago

Thanks, glad to hear this. I am grateful to your work above the plugin, it's really help me in my work. Now, after my correction it's all work like i need, but I will be waiting the upgrade.

oddbear commented 1 year ago

Hi, sorry it has taken some time... (and now I need to validate the plugin against Companion 3.0 that's soon out)

It seems like IsPress, and IsTouchUp only reacts on Press and TouchUp (as expected). IsLongPress will be triggered after a Press, but I don't think Companion has any LongPress support yet.

I also see that Press seems to always be triggered, but the TouchDown only get's triggered if the Loupedeck application is in focus (and sometimes multiple times) That event seems so buggy, so the simple fix would be to just look for Press instead of TouchDown.

This is a strange one, as I cannot believe it has been like this in earlier versions of Loupedeck. But maybe it has...

I will install Companion 3.0 rc1 now, and validate... if that works, I can send this change in for validation.

oddbear commented 1 year ago

Added release if you want to test. https://github.com/oddbear/Loupedeck.Companion.Plugin/releases/tag/v0.2.6

This is the one going to the store after some testing.