Simulated keystrokes are sent twice in Windows Photo Viewer

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
Post Reply
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Simulated keystrokes are sent twice in Windows Photo Viewer

Post by Laurent »

Hi !

I just discovered XMBC (1.53.0) , and it *almost* worked for me :roll:

Want I wanted to do is use the mouse wheel to browse pictures in the default Windows Photo Viewer (which I don't like but is the only one browsing the explorer search results, any other picture viewer browses by folder).

So I opened Windows Photo Viewer, opened XMBC setup page, clicked the Dllhost.exe process (which holds the Photo Viewer) and hooked Wheel Up to {LEFT} and Wheel Down to {right}
Apply.
:arrow: it worked ! :D

BUT...

I close the Photo Viewer, open another image and now each mouse wheel increment skips 1 image (img10->img12->img14...) in both directions.
(Of course, left and right arrows on the keyboard do work fine.)
Argh. :(

I then tried hooking the wheel with the "back" and "forward" functions in XMBC.
It works only the first time, and than nothing happens on the new photo viewers I open.
So it's worse... :?


I'm using a Logitech G500 on Win7 x64, Setpoint installed, but without any profile hooking the photo viewer.
I use to have one, for Tilt Wheel doing the arrows keys (as the Scroll Wheel can't be mapped to left and right in setpoint) and I never had any problems of double key strokes.
So there's got to be a way to do what I'm looking for...


I would be very happy I you could fix this problem !
Any Idea ?

Thanks ! :wink:
MainTrane
Dedicated
Posts: 90
Joined: Wed Jan 26, 2011 12:47 am

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by MainTrane »

Laurent, I'm also running XMBC1.53 on Win7x64 w/ G500/G700. I tried what you said, mapped the scroll wheel to left/right keys for dllhost.exe, and it works flawlessly; so did assigning back/forward to the wheel. Even after closing the photo viewer and opening other pictures elsewhere.

Some things you might be doing wrong:
- make sure your scroll wheel is not in hyper-scroll (no-clicks) mode, this would cause you to scroll faster than intended. photo viewer also has plenty of lag so be patient, don't scroll too fast.
- make sure you didn't choose during, repeatedly or sticky in the simulated keystroke dialog box.
- make sure your scroll wheel is set to scroll one vertical line in setpoint, also in the mouse options in control panel.
- check that the photo viewer is actually the active foremost window, XMBC button assignments only work in active windows, clicking in another window then scrolling the photo viewer won't work.

If anything it's missing scrolls, because Windows Photo Viewer has so much lag, it's too busy loading the next image to receive successive scrolls.
 
  • Beta Tester ‖ Global Moderator
    Logitech [ G700 | G500 | MX1100 ᵛ¹ ᵛ² ]
    Windows 7 Professional 64-bit (6.1, Build 7601)
    Intel Core i7-960 @ 3.85GHz
    18GB (3x4GB+3x2GB) RAM
    DirectX 11
    NVIDIA GeForce 9800 GT
[/size]
MainTrane
Dedicated
Posts: 90
Joined: Wed Jan 26, 2011 12:47 am

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by MainTrane »

Also make sure your not accidentally activating the tilt-wheel on the G500. That tilt-wheel is extremely finicky!
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

Hey, thanks for this fast answer ! :)
And thanks for making the test too !

I checked every point you mentionned - but no sucess :
The photo viewer is still moving 2 files forward or backward every time I scroll 1 step.

I really wonder what's happening here, as the log file in debug mode doesn't seem to indicate anything wrong.
and above all, it's working flawlessly everytime I click on the "Apply" button again !

click "Apply"->open image->WORKS->open another image (2 instances of photo viewer)->WORKS->close one photo viewer->WORKS->close the other and re-open one->DOESN'T WORK (skips one image on each scroll)->click "Apply"->WORKS ...


How come you get it to work on the same system :?:

I have 2 screens, could this be involved ???

My setpoint version is 5.40.39.
By the way I tried creating a profile for dllhost.exe and bind the Tilt wheel to the left and right keys (works perfectly), and then bind the scroll wheel to Tilt wheel in XMBC (lol, I know it's a bit silly) but that didn't work (nothing happened)

:idea: Maybe I'll try it in virtual box with a fresh Win7 to see what happens there.
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

Ok, just tried it in a virtual boxed fresh Win7 Ultimate x64, and it worked.....

So there's got to be something exterior to XMBC involved on my real system.
2 monitors ? Logitech driver ?
(Switcher ? Nexus Dock ? Shell Folder fix ? Classic Shell ? ...)

Any idea is welcomed, but i'll try experimenting a bit and tell if I find.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by phil »

Hi Laurent,

I have dual monitors and its working for me here - so we can rule that one out I think.
Can you post a snippet from the debug log just so I can be sure there isn't anything obviously wrong in there?

BTW: In the long run, I don't think assigning the keys to DLLHost is sensible because it can be used for all sorts of different windows. However, there isn't a better alternative yet - maybe in the next version if MainTrane gets his way :)

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
MainTrane
Dedicated
Posts: 90
Joined: Wed Jan 26, 2011 12:47 am

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by MainTrane »

I also use Switcher 2.0 and it doesn't cause any conflicts. I don't think XMBC can recognize the tilt wheel on Logitech's newer gaming mice!? Definitely not with Setpoint installed.

Have you used XMBC to map buttons for any other apps? If so, do they work as expected?
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

phil wrote:Hi Laurent,

I have dual monitors and its working for me here - so we can rule that one out I think.
Can you post a snippet from the debug log just so I can be sure there isn't anything obviously wrong in there?
Sure - here it is :

Code: Select all

11-02-2011 11:04:15> X-Mouse Button Control v1.53.0 (x64) Startup. Commandline '/notportable /svclaunch'
11-02-2011 11:04:15> Running on Microsoft Windows 7  (build 7600), 64-bit, Hook Timeout: 5000 ms
11-02-2011 11:04:15> Hooking the mouse...
11-02-2011 11:11:44> Opening setup dialog.
11-02-2011 11:12:51> Applying changes to X-Mouse Button Control settings...
11-02-2011 11:12:51> Enabling extra debug logging.
11-02-2011 11:12:53> MouseHookData: Message=0x0201 (WM_LBUTTONDOWN), X=-303, Y=110, mouseData=0x00000000, flags=0x00000000, time=544739, dwExtraInfo=0x0
11-02-2011 11:12:53> Detected active application change (due to mouse) from <unknown> to 'xmousebuttoncontrol.exe'.
11-02-2011 11:12:53> Translating Left Button Down: Action 40 (Nothing (Don't intercept))
11-02-2011 11:12:53> MouseHookData: Message=0x0202 (WM_LBUTTONUP), X=-303, Y=110, mouseData=0x00000000, flags=0x00000000, time=544864, dwExtraInfo=0x0
11-02-2011 11:12:53> Detected active application change (due to mouse) from 'xmousebuttoncontrol.exe' to 'uedit32.exe'.
11-02-2011 11:12:53> Translating Left Button Up: Action 40 (Nothing (Don't intercept))

11-02-2011 11:15:13> MouseHookData: Message=0x0201 (WM_LBUTTONDOWN), X=691, Y=443, mouseData=0x00000000, flags=0x00000000, time=684984, dwExtraInfo=0x0
11-02-2011 11:15:13> Translating Left Button Down: Action 40 (Nothing (Don't intercept))
11-02-2011 11:15:13> MouseHookData: Message=0x0202 (WM_LBUTTONUP), X=691, Y=443, mouseData=0x00000000, flags=0x00000000, time=685062, dwExtraInfo=0x0
11-02-2011 11:15:13> Translating Left Button Up: Action 40 (Nothing (Don't intercept))
11-02-2011 11:15:14> MouseHookData: Message=0x0201 (WM_LBUTTONDOWN), X=691, Y=443, mouseData=0x00000000, flags=0x00000000, time=685140, dwExtraInfo=0x0
11-02-2011 11:15:14> Detected active application change (due to mouse) from 'uedit32.exe' to 'explorer.exe'.
11-02-2011 11:15:14> Translating Left Button Down: Action 40 (Nothing (Don't intercept))

11-02-2011 11:15:14> MouseHookData: Message=0x0202 (WM_LBUTTONUP), X=691, Y=443, mouseData=0x00000000, flags=0x00000000, time=685234, dwExtraInfo=0x0
11-02-2011 11:15:14> Detected active application change (due to mouse) from 'explorer.exe' to 'dllhost.exe'.
11-02-2011 11:15:14> Enabling application specific button settings for 'dllhost.exe'...
11-02-2011 11:15:14> Left = Nothing (Don't intercept) Right = Nothing (Don't intercept) Middle = Nothing (Don't intercept) 4th = Nothing (Don't intercept) 5th = Nothing (Don't intercept) Tilt Left = Nothing (Don't intercept) Tilt Right = Nothing (Don't intercept) InvertScrolling=off ScrollPages=off
11-02-2011 11:15:14> Setting application settings to layer 0
11-02-2011 11:15:14> Translating Left Button Up: Action 40 (Nothing (Don't intercept))

11-02-2011 11:15:17> MouseHookData: Message=0x020a (WM_MOUSEWHEEL), X=691, Y=443, mouseData=0xFF880000, flags=0x00000000, time=688947, dwExtraInfo=0x0
11-02-2011 11:15:17> Translating WheelDown Button Down: Action 28 (Simulated Keystrokes)
11-02-2011 11:15:17> Translating WheelDown Button Up: Action 28 (Simulated Keystrokes)
11-02-2011 11:15:17> SendKeyState: VKCode=0x27 Scancode=0x0 Flags=0x0 Release=0:
11-02-2011 11:15:17> SendKeyState: VKCode=0x27 Scancode=0x0 Flags=0x0 Release=1:
:arrow: Here I had 1 image skipped

Now back to UltraEdit :

Code: Select all

11-02-2011 11:15:25> MouseHookData: Message=0x0201 (WM_LBUTTONDOWN), X=-846, Y=485, mouseData=0x00000000, flags=0x00000000, time=697059, dwExtraInfo=0x0
11-02-2011 11:15:25> Translating Left Button Down: Action 40 (Nothing (Don't intercept))
11-02-2011 11:15:26> MouseHookData: Message=0x0202 (WM_LBUTTONUP), X=-846, Y=485, mouseData=0x00000000, flags=0x00000000, time=697215, dwExtraInfo=0x0
11-02-2011 11:15:26> Detected active application change (due to mouse) from 'dllhost.exe' to 'uedit32.exe'.
11-02-2011 11:15:26> Enabling default button settings...
11-02-2011 11:15:26> Left = Nothing (Don't intercept) Right = Nothing (Don't intercept) Middle = Nothing (Don't intercept) 4th = Nothing (Don't intercept) 5th = Nothing (Don't intercept) Tilt Left = Nothing (Don't intercept) Tilt Right = Nothing (Don't intercept) InvertScrolling=off ScrollPages=off
11-02-2011 11:15:26> Setting application settings to layer 0
11-02-2011 11:15:26> Translating Left Button Up: Action 40 (Nothing (Don't intercept))
11-02-2011 11:15:27> MouseHookData: Message=0x0201 (WM_LBUTTONDOWN), X=-830, Y=649, mouseData=0x00000000, flags=0x00000000, time=698229, dwExtraInfo=0x0
11-02-2011 11:15:27> Translating Left Button Down: Action 40 (Nothing (Don't intercept))
11-02-2011 11:15:27> MouseHookData: Message=0x0202 (WM_LBUTTONUP), X=-830, Y=649, mouseData=0x00000000, flags=0x00000000, time=698322, dwExtraInfo=0x0
11-02-2011 11:15:27> Translating Left Button Up: Action 40 (Nothing (Don't intercept))

Nothing seems wrong for me...


Another thing I tried is add the Photo Viewer Window to the "Window Scrolling" Tab in XMBC Advanced Settings, and select Scroll Method 3 (Left/Right Keys) with Vertical Lines set to 1.
But sadly nothing happened, the wheel kept its default behavior (Zoom)
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

MainTrane wrote:I also use Switcher 2.0 and it doesn't cause any conflicts. I don't think XMBC can recognize the tilt wheel on Logitech's newer gaming mice!? Definitely not with Setpoint installed.

Have you used XMBC to map buttons for any other apps? If so, do they work as expected?
Yes, I tried it with UltraEdit, with the same hook (Wheel to left/right keys)
And it works perfectly (type cursor moves 1 char on each scroll step), even when I close and reopen the UltraEdit process.
MainTrane
Dedicated
Posts: 90
Joined: Wed Jan 26, 2011 12:47 am

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by MainTrane »

Installed ShellFolderFix & Classic Shell, they didn't duplicate your issue.

If you don't use Windows Live Photo Gallery, install it and try the same button mappings you did for Windows Photo Viewer (they're very similar, both have the same default scrolling function).
WLPG is named wlxphotogallery.exe

If it creates the same issue... well... I don't know what phil will be able to deduce from that.

If it doesn't... it has a search filter of it's own, and will also abide by Explorer search results if you allow it to take over as the default viewer.
WLPG is also more responsive and has more/better features than WPV.
 
  • Beta Tester ‖ Global Moderator
    Logitech [ G700 | G500 | MX1100 ᵛ¹ ᵛ² ]
    Windows 7 Professional 64-bit (6.1, Build 7601)
    Intel Core i7-960 @ 3.85GHz
    18GB (3x4GB+3x2GB) RAM
    DirectX 11
    NVIDIA GeForce 9800 GT
[/size]
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by phil »

Another thing I tried is add the Photo Viewer Window to the "Window Scrolling" Tab in XMBC Advanced Settings, and select Scroll Method 3 (Left/Right Keys) with Vertical Lines set to 1.
But sadly nothing happened, the wheel kept its default behaviour (Zoom)
Well that does not surprise me, because it makes the HORIZONTAL scroll into left right keys - you seem to be talking about the wheel rather than tilt so the wheel will never operate keys in this mode. Plus if you still had the app specific profile, that would take precedence over the wheel scrolling changes I think.

Also I just noticed this:
By the way I tried creating a profile for dllhost.exe and bind the Tilt wheel to the left and right keys (works perfectly), and then bind the scroll wheel to Tilt wheel in XMBC (lol, I know it's a bit silly) but that didn't work (nothing happened)
That does not surprise me at all because the setpoint profile will be operating at a lower level so it wont see the tilt that XMBC injects.


This certainly is very strange - the log does not indicate any problem to me either :(.
Did you try mapping {LEFT}/{RIGHT} to buttons (say 4th and 5th) ... when you did that, did it work or did it skip?

The only other thing could be a timing issue - maybe its seeing a key repeat for some reason - but then I would assume the same problem on the 4th/5th buttons if that is the case. What spec is your machine (roughly)?

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

Hey guys, I really appreciate your concern for my problem, many thanks !

I tried killing each process one by one from my system, and found out that getting rid of SetPointII.exe would solve the problem.
That's strange, because I had no setpoint profile including dllhost.exe, and above all the wheel is not configurable with setpoint.

So I had three options :

1. Getting rid of setpoint and using XMBC for all my mouse assignements. But I would loose some of my G500 fine tuning functionnalities by doing so.
-> I didn't choose this option.

2. Try moving to the latest version of setpoint (something I should have done before actually)
-> Did it, but it didn't change anything. While Setpoint is running, the problem occurs.

So I deactivated all automatic profile changes in setpoint, and it WORKED.
(= No need to click "apply" in XMBC each time I launch the photo viewer in order to wheel-change images one by one.)

-> So maybe I could try reproducing each setpoint profile in XMBC, and that would be a solution.

3. Try Windows Live Photo Gallery
If this viewer can indeed browse the explorer search results, it could also become a good solution for me.
But I wasn't able to install it with the redistribuable version I found (lots of missing dlls)
(The default WLPG web-installer is not an option for me as my main PC has no Internet connexion and will never have one.)
But I'll try again later, as it could really be a solution - thanks MainTrane.

This certainly is very strange - the log does not indicate any problem to me either :(.
Did you try mapping {LEFT}/{RIGHT} to buttons (say 4th and 5th) ... when you did that, did it work or did it skip?
Actually XMBC doesn't work at all whan I bind any other button than the scroll wheel, as I already assigned them to special functions in setpoint and it is always these functions that are executed instead of XMBC settings. I guess there's a problem there too ?
I just noticed that as I press middle button, set to "minimize active window" in setpoint in default profile, whether or not it's reassigned in XMBC it minimizes the windows, and then re-maximizing it and scrolling skips an image even if clicked the "apply" button in XMBC just before minimizing it (to make scrolling work fine at first). So no need to close and reopen the photo viewer to break things. It seems that when setpoint functions gets involved, they "break" XMBC. :?

Roughly, my PC is a Core i7 980X with 12GB of RAM, nVidia 580 GTX, as Phil asks.

:idea:
Phil, I don't know what would this solution imply exactly, but what would happen if the code behind the "apply" button be called every time a hooked exe window is activated ?
(That would solve my problem, but this would probably lead to new ones for other people :oops: )

Thanks again, both of you ! :D
Laurent
New User
Posts: 7
Joined: Thu Feb 10, 2011 8:28 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by Laurent »

Forgot to mention that the exact same problem occurs with Windows Live Photo Gallery, so my third solution was not a solution...

And the problem is definitely not linked with dllhost.exe
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by phil »

Actually XMBC doesn't work at all whan I bind any other button than the scroll wheel, as I already assigned them to special functions in setpoint and it is always these functions that are executed instead of XMBC settings. I guess there's a problem there too ?
If you configure setpoint to change the button assignments, XMBC will not see them. XMBC relies on windows button messages. You are saying you changed setpoint not to send them - so XMBC wont work in that case. Its not a problem (with XMBC) - its just how you have setup your mouse.

Its certainly weird, but as I don't use setpoint, and I don't have a problem, I guess that's causing some issue. However, MainTrane is using setpoint and does not seem to have any problems either :(

Not sure that I have any more ideas on this right now :(

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
MainTrane
Dedicated
Posts: 90
Joined: Wed Jan 26, 2011 12:47 am

Re: Simulated keystrokes are sent twice in Windows Photo Vie

Post by MainTrane »

I'm running the G500 on Setpoint v5.42.34 w/ Driver v5.20.51 and I'm not seeing any conflicts with XMBC in either WLPG or WPV.  Automatic profile switching is enabled in Setpoint also.

WheelDown is remapped to Back
WheelUp is remapped to Forward
MiddleButton is remapped to {CTRL}0  <  toggles full-size/fit-window in WLPG

Like Phil has said, XMBC won't see buttons unless they're sending the standard mouse clicks labeled in the XMBC interface.
 
  • Beta Tester ‖ Global Moderator
    Logitech [ G700 | G500 | MX1100 ᵛ¹ ᵛ² ]
    Windows 7 Professional 64-bit (6.1, Build 7601)
    Intel Core i7-960 @ 3.85GHz
    18GB (3x4GB+3x2GB) RAM
    DirectX 11
    NVIDIA GeForce 9800 GT
[/size]
Post Reply