Dopamine


Recommended Posts

I have the G15 with 18 G Keys and Fold-able LCD Screen. I'll check it out on mine when I get home.

 

In theory, you're correct, but if this is written with the .Net Framework... Haha, we all know Windows can be sketchy some times.

 

Well I'm not using Keys.MediaPlayPause/Keys.MediaNextTrack etc. Because those only work when the application has focus. I've implemented a low level keyboard hook that listen to keypresses even when the application as no focus. However it seems it doesn't catch pressing media keys on all keyboards. Unbelievable there is still no standard to do such thing :)

 

EDIT: hah! I think I found some useful info on the web. There exist other keycodes I didn't kjnow of. I'll update my KeyboardTest app tonight.

Link to comment
Share on other sites

I've got to say, now that I'm back on Windows this has got to be one of my favourite applications. It just looks so clean and works perfectly for me! Incredible work, Rapha

Link to comment
Share on other sites

To everyone with non-working media keys, could you download KeyBoardTest2.exe here https://www.dropbox.com/sh/ad3r5xsi15nubku/AADmBgbyz4aJiMGH2YUDwkmBa?dl=0

 

Could you launch it and press, in this order, on these media keys and post a screenshot of the result in the app (if it reacted to the keypressed at least):

 

1. Mediakey Play

2. Mediakey Pause

3. Mediakey Previous

4. Mediakey Next

5. Mediakey Stop

6. Mediakey Volume Up

7. Mediakey Volume Down

 

Thanks!

Link to comment
Share on other sites

Is it portable?

 

Yes! There is a portable version.

I've got to say, now that I'm back on Windows this has got to be one of my favourite applications. It just looks so clean and works perfectly for me! Incredible work, Rapha

Link to comment
Share on other sites

360 Total Security quarantined KeyboardTest5.exe and wont let me run it, even though I have restored it, and white-listed it. :rolleyes:

 

post-18738-0-96443200-1432669659.png

 

https://www.virustotal.com and http://virusscan.jotti.org both gave it a 100% clean bill of health

 

On the plus side, the media keys on my K300 work fine with Dopamine, in and out of focus :)

Link to comment
Share on other sites

360 Total Security quarantined KeyboardTest5.exe and wont let me run it, even though I have restored it, and white-listed it. :rolleyes:

 

attachicon.gif2015-05-26_20-25-36.png

 

https://www.virustotal.com and http://virusscan.jotti.org both gave it a 100% clean bill of health

 

On the plus side, the media keys on my K300 work fine with Dopamine, in and out of focus :)

 

360 is getting on my nerves :rofl: It flags all my software as viruses. I've put the source code of the KeyboardTest app in the same directory as KeyBoardTest5.exe. As proof that 360 is crazy :)

I didn't have time yet to look into signing or strong naming my applications, which, I hope, would solve getting false positives in some anti-viruses.

 

AS for the keys not working for some keyboards. I'm starting to suspect that the keyboard software might do something non-standard or that it is not possible to listen to those keyboar messages from a .NET application. I'm still not 100% sure.

Link to comment
Share on other sites

nCode='0', wParam='&H100', vkCode='179'
nCode='0', wParam='&H101', vkCode='179'
nCode='0', wParam='&H100', vkCode='178'
nCode='0', wParam='&H101', vkCode='178'
nCode='0', wParam='&H100', vkCode='174'
nCode='0', wParam='&H101', vkCode='174'
nCode='0', wParam='&H100', vkCode='174'
nCode='0', wParam='&H101', vkCode='174'
nCode='0', wParam='&H100', vkCode='176'
nCode='0', wParam='&H101', vkCode='176'
nCode='0', wParam='&H100', vkCode='177'
nCode='0', wParam='&H101', vkCode='177'
nCode='0', wParam='&H100', vkCode='173'
nCode='0', wParam='&H101', vkCode='173'
nCode='0', wParam='&H100', vkCode='162'
nCode='0', wParam='&H100', vkCode='67'

Here are my G15 Keys. I pressed every key. When I get my new Orion keyboard here in a few weeks, I'll test it for you too.

 

Edit:

Last 2 keys, are Copy & Paste. Haha.

Link to comment
Share on other sites

I have found the problem with the Logitech keyboards.  It is the Logitech SetPoint drivers causing the issue.  Their drivers do something special with the media keys.  I have fixed the issue by doing 2 different things.  I will explain them below.

 

1.  Uninstall the SetPoint drivers.  This will fix the issue and the media keys will then work in Dopamine.

 

2.  If you don't want to uninstall the drivers, you can change the configuration for your particular keyboard so that SetPoint does not intercept these keys.  For my K800 I modified the c:\programdata\Logishrd\SetPointP\Devices\Keyboard\2000074\2000074.xml file.  I removed the following sections from this file:

 

        <!-- Button Name => f10 Previous Track -->

        <Button Number="786614" Name="Previous Track">

          <Trigger Class="ButtonPress">

            <PARAM Button="786614" LongPressTime="300" />

            <TriggerState Name="ButtonDownUp"        HandlerSet="MM PREVIOUS"  HandlerSetGroup="Keyboard"  />

            <TriggerState Name="ButtonLongPress"    HandlerSet="MM REWIND" />

          </Trigger>

        </Button>

        <!-- Button Name => fn F11 Play -->

                <Button Number="786637" Name="F11">

                    <Trigger Class="ButtonPress">

                        <PARAM Button="786637" />

                        <TriggerState Name="ButtonDownUp" HandlerSet="MM PLAY"  HandlerSetGroup="F12KeysGroup"  />

                    </Trigger>

                </Button>

                <!-- Button Name => F12 Next Track  -->

                <Button Number="786613" Name="Next Track">

                    <Trigger Class="ButtonPress">

            <PARAM Button="786613" LongPressTime="300" />

            <TriggerState Name="ButtonDownUp"        HandlerSet="MM NEXT"  HandlerSetGroup="Keyboard"  />

            <TriggerState Name="ButtonLongPress"    HandlerSet="MM FASTFORWARD" />

          </Trigger>

                </Button>

 

I removed the button configurations for the media keys, restarted SetPoint, and the media keys then worked in Dopamine with SetPoint installed.  You will need to find the XML file for your specific device by searching the folders.  The display name that is shown in SetPoint for the keyboard is at the top of the XML file and that is what I searched on to find the XML file for my keyboard. Once the configuration for the media buttons is removed for your device, the keys should start working in Dopamine.

 

Raphael...I'm not sure if there is anything you can do about this code wise.  This looks to be an issue when running the Logitech SetPoint drivers with a Logitech keyboard.  It looks like one of the two methods above will have to be used when using a Logitech keyboard to get the media keys to work in Dopamine.

 

You rule! Thanks for the info! :) I was starting to suspect such thing. I've read about the SetPoint software in another forum but wasn't sure this was causing the media key issue.

nCode='0', wParam='&H100', vkCode='179'
nCode='0', wParam='&H101', vkCode='179'
nCode='0', wParam='&H100', vkCode='178'
nCode='0', wParam='&H101', vkCode='178'
nCode='0', wParam='&H100', vkCode='174'
nCode='0', wParam='&H101', vkCode='174'
nCode='0', wParam='&H100', vkCode='174'
nCode='0', wParam='&H101', vkCode='174'
nCode='0', wParam='&H100', vkCode='176'
nCode='0', wParam='&H101', vkCode='176'
nCode='0', wParam='&H100', vkCode='177'
nCode='0', wParam='&H101', vkCode='177'
nCode='0', wParam='&H100', vkCode='173'
nCode='0', wParam='&H101', vkCode='173'
nCode='0', wParam='&H100', vkCode='162'
nCode='0', wParam='&H100', vkCode='67'

Here are my G15 Keys. I pressed every key. When I get my new Orion keyboard here in a few weeks, I'll test it for you too.

 

Edit:

Last 2 keys, are Copy & Paste. Haha.

 

Thanks! I'll compare this to the current code.

Link to comment
Share on other sites

Well it is essentially a keylogger (although not malicious), so I guess it's good that 360 picks it up  :)

 

You have a point. I wonder if that is the reason why Dopamine is also being picked up by some anti-viruses. The same code comes back in Dopamine.

Link to comment
Share on other sites

I have found the problem with the Logitech keyboards.  It is the Logitech SetPoint drivers causing the issue.  Their drivers do something special with the media keys.  I have fixed the issue by doing 2 different things.  I will explain them below.

 

1.  Uninstall the SetPoint drivers.  This will fix the issue and the media keys will then work in Dopamine.

 

2.  If you don't want to uninstall the drivers, you can change the configuration for your particular keyboard so that SetPoint does not intercept these keys.  For my K800 I modified the c:\programdata\Logishrd\SetPointP\Devices\Keyboard\2000074\2000074.xml file.  I removed the following sections from this file:

 

<snip>

 

I removed the button configurations for the media keys, restarted SetPoint, and the media keys then worked in Dopamine with SetPoint installed.  You will need to find the XML file for your specific device by searching the folders.  The display name that is shown in SetPoint for the keyboard is at the top of the XML file and that is what I searched on to find the XML file for my keyboard. Once the configuration for the media buttons is removed for your device, the keys should start working in Dopamine.

 

Raphael...I'm not sure if there is anything you can do about this code wise.  This looks to be an issue when running the Logitech SetPoint drivers with a Logitech keyboard.  It looks like one of the two methods above will have to be used when using a Logitech keyboard to get the media keys to work in Dopamine.

 

Interesting. Setpoint must be doing something specific on it's own for VLC and other media apps then?

Link to comment
Share on other sites

Isn't there a standard key name for those keys? Like we have Generic Drivers, are there generic settings?

It's strange that WMP, VLC and Foobar2000 can use the keyhooks and not get flagged.

Does the software install any files to the registration? Maybe they use a generic windows library that's known to the AV programs? Who knows. It's interesting to see!

Link to comment
Share on other sites

I do not have setpoint installed.

 

Edit: Can confirm that installing setpoint ###### it up.

 

Edit 2: And that uninstalling setpoint un-###### it up :)

Link to comment
Share on other sites

This is for my A4Tech (Chinese) keyboard, it caused two events for each press.

 

Play and Pause are same button:

nCode='0', wParam='&H100', vkCode='179'
nCode='0', wParam='&H101', vkCode='179'
nCode='0', wParam='&H100', vkCode='179'
nCode='0', wParam='&H101', vkCode='179'
nCode='0', wParam='&H100', vkCode='177'
nCode='0', wParam='&H101', vkCode='177'
nCode='0', wParam='&H100', vkCode='176'
nCode='0', wParam='&H101', vkCode='176'
nCode='0', wParam='&H100', vkCode='178'
nCode='0', wParam='&H101', vkCode='178'
nCode='0', wParam='&H100', vkCode='175'
nCode='0', wParam='&H101', vkCode='175'
nCode='0', wParam='&H100', vkCode='174'
nCode='0', wParam='&H101', vkCode='174'
Link to comment
Share on other sites

I think that I might have stumbled on part of the solution. I was looking around the setpoint config files and found this:

#List of supported players
#{btn|key|msg|emg|cmd|wac},exeName,wndClass,wndCaption,xxx,play_delayplay,pause,stop,prev,next,remove_flags,ShowOSD,menu_item
#special char --> ^ ctrl;+ shift+ctrl; $ ctrl (no translation); * alt (no translation); @ ctrl+alt (no tanslation); & (no translation) 
at: C:\Program Files\Logitech\SetPointP\players.ini
 
Maybe you could somehow add in dopamine to the list?-
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now