Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_appcommand (Read 28923 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_appcommand

This little plugin adds the ability to assign multimedia keyboard buttons that sends APPCOMMAND (for example some HP keyboards) as (global) keyboard hotkeys.

In other words, if you can't add your multimedia keys in the keyboard-shortcuts settings screen, then try this plugin. Just unzip to the components folder, restart fb2k and then try to add the keys as shortcuts again.

[attachment=3283:attachment]
---

foo_appcommand

Reply #1
THANKS!!!!!!  Finally I'm able to use my Logitech diNovo
Can't wait for a HD-AAC encoder :P

foo_appcommand

Reply #2
Works well, thank you! 

Easier than doing the registry hack routine... 

foo_appcommand

Reply #3
Works perfectly. Finally using those MM buttons.

foo_appcommand

Reply #4
Works perfectly with Logitech Elite, thanks!

foo_appcommand

Reply #5
Sorry for the stupid question but how do you use this? I don't really know how you're supposed to set keyboard shortcuts... 

foo_appcommand

Reply #6
any possibility of completely disabling MM keys?

 

foo_appcommand

Reply #7
This sounds like an awesome component, but I just tried using it, and whenever I press one of the buttons on my laptop, it automatically opens windows media player, which obviously I don't want. Hmm I suppose I could just uninstall WMP. But is there another way around this?

Also, is it possible to set up these MM buttons so that they ALWAYS control foobar, not just when foobar is the active program? that would be v. awesome.

foo_appcommand

Reply #8
This sounds like an awesome component, but I just tried using it, and whenever I press one of the buttons on my laptop, it automatically opens windows media player, which obviously I don't want. Hmm I suppose I could just uninstall WMP. But is there another way around this?

Did you set your buttons in the "Keyboard Shortcuts" properties? After the installation of this component, it will detect these multimedia buttons as other keys.
Can't wait for a HD-AAC encoder :P

foo_appcommand

Reply #9
Did you set your buttons in the "Keyboard Shortcuts" properties? After the installation of this component, it will detect these multimedia buttons as other keys.


I did that, but it's still opening WMP. I figured out how to make them Global Hotkeys though. (It wasn't exactly hard.  )

foo_appcommand

Reply #10
Thank you, Svante!

foo_appcommand

Reply #11
Did you set your buttons in the "Keyboard Shortcuts" properties? After the installation of this component, it will detect these multimedia buttons as other keys.

I did that, but it's still opening WMP. I figured out how to make them Global Hotkeys though. (It wasn't exactly hard.  )

If there are not settings which bind the keys to WMP in the windows control panel, then there are probably registry keys you can edit.

foo_appcommand

Reply #12
Apologies for the necro but it makes more sense to post in the thread about this component.

I'm curious if anyone is able to make this work with Razer's Tarantula keyboard. Foobar still will not recognize the play/stop and prev/next keys even with the appcommand component.

foo_appcommand

Reply #13
Excellent. Works like a charm! Thanks for this!

foo_appcommand

Reply #14
*BUMP*

can someone update this plugin so that it'll work with the new foobar2000 version?


foo_appcommand

Reply #16
I don't have the time to look into the new API-version or use a keyboard that sends appcommand-messages so I cannot update it for now, however here is the code if anyone is interested in it. Feel free to do anything with it!

Defines:
Code: [Select]
#define HSHELL_APPCOMMAND           12
#define FAPPCOMMAND_MASK  0xF000
#define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
#define APPCOMMAND_MEDIA_NEXTTRACK        11
#define APPCOMMAND_MEDIA_PREVIOUSTRACK    12
#define APPCOMMAND_MEDIA_STOP             13
#define APPCOMMAND_MEDIA_PLAY_PAUSE       14
#define WM_APPCOMMAND                   0x0319


The init function:
Code: [Select]
// Add the ShellProc hook
hShellHook = SetWindowsHookEx(
                WH_SHELL,                    // Hook in before msg reaches app
                (HOOKPROC) ShellProc,            // Hook procedure
                core_api::get_my_instance(),    // This DLL instance
                0L                                // Hook in to all apps
                );


The quit function:
Code: [Select]
UnhookWindowsHookEx(hShellHook);


The main function:
Code: [Select]
// Hook procedure for Shell hook

LRESULT CALLBACK ShellProc(int nCode, WPARAM wParam, LPARAM lParam)
{
    // Do we have to handle this message?
    if (nCode == HSHELL_APPCOMMAND)
    {
        short AppCommand = GET_APPCOMMAND_LPARAM(lParam);
        switch (AppCommand)
        {
        case APPCOMMAND_MEDIA_NEXTTRACK:
            keybd_event(VK_MEDIA_NEXT_TRACK,0,0,0);
            return 1;
        case APPCOMMAND_MEDIA_PLAY_PAUSE:
            keybd_event(VK_MEDIA_PLAY_PAUSE,0,0,0);
            return 1;
        case APPCOMMAND_MEDIA_PREVIOUSTRACK:
            keybd_event(VK_MEDIA_PREV_TRACK,0,0,0);
            return 1;
        case APPCOMMAND_MEDIA_STOP:
            keybd_event(VK_MEDIA_STOP,0,0,0);
            return 1; // dont call CallNextHookEx, instead return non-zero, because we have handled the message (see MSDN doc)
        }
    }

    // Call the next handler in the chain
    return CallNextHookEx (hShellHook, nCode, wParam, lParam);
}
---

foo_appcommand

Reply #17
didn't work on windows seven.. 

foo_appcommand

Reply #18
Hi,

I'm using Windows 7 Build 7100. I have Logitech EX110, media keys works fine, but when I start Foobar (0.9.6.5) an error comes up.

Failed to load DLL: foo_appcommand.dll
Reason: This component is not compatible with this version of Windows and needs to be recompiled with a newer version of the foobar2000 SDK; please contact the author of this component to obtain an updated version of this component.

I've tried to uninstall foobar, but still the same, if I uninstall Appcommand, I cant use my media keys.

Any idea how can i disable this error message?

Regadrs,

Rambo Junior

foo_appcommand

Reply #19
Author of the plugin has to recompile component. I did that thing with my foo_dock and it worked.

foo_appcommand

Reply #20
I don't have the time to look into the new API-version or use a keyboard that sends appcommand-messages so I cannot update it for now, however here is the code if anyone is interested in it. Feel free to do anything with it!

Code: [Select]
(snip)


Well, if author hasn't enough time to recompile this plugin, could someone do it for us? I'd do it if I knew how to. HP multimedia keyboards doesn't work in foobar2k without it, in windows 7 at least.

Moderation: Removed useless part of full quote.