|
|
|
|
#1 |
|
Junior Member
Join Date: Feb 2009
Posts: 6
|
Add Keyboard Accelerator - General purpose plugin
Hello.
I want to add a keyboard accelerator like ALT + A or A for my general purpose plugin. I have tried some times but until this moment it haven't worked The first form that I tried was with: 1. In the process WinampSubclassProc I added: code: But it only works when the screen is positioned over the main window of winamp. It doesn't work when is opened other plugin or other window. 2. The second form was with a accelerator (Resources): code: It worked well with the accelerator, but winamp began to be slow and it didn't answer to some requests. Beside it began to show mistakes. 3. The third form was: I added soport for api_service and api_aplication In the init: code: After this in: code: but although it show "build succeded" and it started the plugin, In Execute time it show the mistake in "applicationApi->app_addAccelerators". With this last form I was testing it but in internet I didn't find examples about it, how I should use it?. I'm not sure if I doing it well and I would like knowing if you have some examples where it works for add a keyboard accelarator to a general purpose plugin. Thanks for your attention. Fabio |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2008
Posts: 114
|
I dont know if wa_hotkeys.h will be appropriate
|
|
|
|
|
|
#3 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,278
|
as i don't have access to an code this is all going tobe going on my memory so if it's wrong then i apologise now.
wa_hotkeys.h won't be appropriate in this instance. i'll assume this is to have a means to toggle a window and if so then prior to 5.53 you're best using IPC_TRANSLATEACCEL (think that'st the right api) and from 5.53+ you will need to use the api_service method. what has been pasted for the api_service implementation looks wrong as it's constantly trying to add the association on all messages through the window proceedure and should only be done once either in init(..) or on a delayed loading callback (custom WM_WA_IPC into a subclassed Winamp window proc via PostMessage(..) in init(..) ). once it's working then all you need to do is handle the respective WM_COMMAND message against the command id set (there's an api that will allocate you a value which shouldn't have been already used by Winamp added in 5.1x i think - is in wa_ipc.h near the bottom). -daz |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Feb 2009
Posts: 6
|
Thanks for your reply, unfortunately I have tried to find examples of code and how to do the verification with IPC_TRANSLATEACCELERATOR to add support to versions prior to 5.53 and the of use api_service for versions 5.33+ but I have not made progress.
After that I can upload accelerators, I know that can be handled with the respective WM_COMMAND message and this part I already have ready. I have tried to look at the SDK and in the application code for winamp plugins that have code public, but none have used or IPC_TRANSLATEACCELERATOR nor api_service to load accelerators. I am very inexperienced in this subject, and the plugin that I have developed was the first I've done and I only need to correct this subject accelerated. Regarding options that you mentioned to make calls in the init (..) or on a delayed loading callback, you could help me with some example code? or with a link to a plug-in with public code to see if I can guide me a little better. Sorry for my english |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|