Topics

SDR# Shortcuts Plugin...

Edward MacDonald
 

This message is probably best answered by Prog, however if any one else has some direction it is welcomed.

So here is my question...

I have created all the working code for the shortcuts plugin. It works well. However;

The plugin only works when my plugin control window is open in the plugin panel. One the plugin panel is closed, there is no way for my plugin to work. This basically defeats the purpose of shortcuts as some users may not keep the panel expanded or even keep my plugin panel expanded either.

Where do I place my code to intercept key data? Sure I can use the messaging system to pre-filter for key data, but is that allowed? If not can I add a handler to to the Control.Parent form in my User Control? Is that allowed? I do not want to go around your proxies nor break your social code of conduct. Is there a way you could expose the key event data to us as plugin creators?

What do you suggest as the best way to implement the shortcuts when the main application has focus keeping in mind that some plugin controls may have text entry I do not want to interfere with either.

Any direction you could give me would be much appreciated.

As I said the plugin currently works well, but only when the plugin panel and my plugin user control are both expanded 

Thanks for any help.

Eddie 

prog
 
Edited

On Wed, Oct 2, 2019 at 07:57 AM, Edward MacDonald wrote:
What do you suggest as the best way to implement the shortcuts when the main application has focus keeping in mind that some plugin controls may have text entry I do not want to interfere with either.
As long as you don't alter the messages, you should be fine.  You can add a filter that intercepts the interesting keys from the program's main message loop. Basically, always return false in the following function: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.application.addmessagefilter?redirectedfrom=MSDN&view=netframework-4.6

Edward MacDonald
 

Thanks so much for your help. I really appreciate it. 

I will try and get this finished now.

Eddie

On Wed, Oct 2, 2019, 3:39 PM prog, <info@...> wrote:

[Edited Message Follows]

On Wed, Oct 2, 2019 at 07:57 AM, Edward MacDonald wrote:
What do you suggest as the best way to implement the shortcuts when the main application has focus keeping in mind that some plugin controls may have text entry I do not want to interfere with either.
As long as you don't alter the messages, you should be fine.  You can add a filter that intercepts the interesting keys from the program's main message loop. Basically, always return false in the following function: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.application.addmessagefilter?redirectedfrom=MSDN&view=netframework-4.6

Edward MacDonald
 

The shortcuts plugin is complete and available for download from my website. 

The plugin has been tested with the latest version of SDR#. (I do not guarantee  compatibility with older versions.)

There are 33 shortcuts available covering detector types, volume control, zoom control, squelch control, frequency and filter bandwidth controls. Ability to start / stop the  radio, mute audio, etc... 

Function keys F1 through F10 control the band selections.

For the time being all the shortcut keys are staticly mapped. There is a legend provided in the plugin to view key assignments.

I will try and code for user selectable shortcuts at a later date. I have a lot of other coding of older plugins going on and trying to finish the TMate2 controller plugin.

If anyone has any suggestions or finds a bug please let me know.

The shortcuts work only when the SDR# app has focus, even if the plugin or plugin panel are minimized (thanks Prog)

Hope it works well for all of you.

On Thu, Oct 3, 2019, 3:03 AM Edward MacDonald via Groups.Io, <edwardmacdonald74=gmail.com@groups.io> wrote:
Thanks so much for your help. I really appreciate it. 

I will try and get this finished now.

Eddie

On Wed, Oct 2, 2019, 3:39 PM prog, <info@...> wrote:

[Edited Message Follows]

On Wed, Oct 2, 2019 at 07:57 AM, Edward MacDonald wrote:
What do you suggest as the best way to implement the shortcuts when the main application has focus keeping in mind that some plugin controls may have text entry I do not want to interfere with either.
As long as you don't alter the messages, you should be fine.  You can add a filter that intercepts the interesting keys from the program's main message loop. Basically, always return false in the following function: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.application.addmessagefilter?redirectedfrom=MSDN&view=netframework-4.6

Everett N4CY
 

Hi Ed,

What is the link to your website?

Everett N4CY

In a message dated 10/4/2019 5:07:02 AM Central Standard Time, edwardmacdonald74@... writes:

The shortcuts plugin is complete and available for download from my website. 

The plugin has been tested with the latest version of SDR#. (I do not guarantee  compatibility with older versions.)

There are 33 shortcuts available covering detector types, volume control, zoom control, squelch control, frequency and filter bandwidth controls. Ability to start / stop the  radio, mute audio, etc...

Function keys F1 through F10 control the band selections.

For the time being all the shortcut keys are staticly mapped. There is a legend provided in the plugin to view key assignments.

I will try and code for user selectable shortcuts at a later date. I have a lot of other coding of older plugins going on and trying to finish the TMate2 controller plugin.

If anyone has any suggestions or finds a bug please let me know.

The shortcuts work only when the SDR# app has focus, even if the plugin or plugin panel are minimized (thanks Prog)

Hope it works well for all of you.

On Thu, Oct 3, 2019, 3:03 AM Edward MacDonald via Groups.Io, <edwardmacdonald74=gmail.com@groups.io> wrote:
Thanks so much for your help. I really appreciate it. 

I will try and get this finished now.

Eddie

On Wed, Oct 2, 2019, 3:39 PM prog, <info@...> wrote:

[Edited Message Follows]

On Wed, Oct 2, 2019 at 07:57 AM, Edward MacDonald wrote:
What do you suggest as the best way to implement the shortcuts when the main application has focus keeping in mind that some plugin controls may have text entry I do not want to interfere with either.
As long as you don't alter the messages, you should be fine.  You can add a filter that intercepts the interesting keys from the program's main message loop. Basically, always return false in the following function: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.application.addmessagefilter?redirectedfrom=MSDN&view=netframework-4.6

prog
 

On Fri, Oct 4, 2019 at 12:06 PM, Edward MacDonald wrote:
The shortcuts plugin is complete and available for download from my website. 
 
The plugin has been tested with the latest version of SDR#. (I do not guarantee  compatibility with older versions.)
 
There are 33 shortcuts available covering detector types, volume control, zoom control, squelch control, frequency and filter bandwidth controls. Ability to start / stop the  radio, mute audio, etc... 
 
Function keys F1 through F10 control the band selections.
 
For the time being all the shortcut keys are staticly mapped. There is a legend provided in the plugin to view key assignments.
 
I will try and code for user selectable shortcuts at a later date. I have a lot of other coding of older plugins going on and trying to finish the TMate2 controller plugin.
 
If anyone has any suggestions or finds a bug please let me know.
 
The shortcuts work only when the SDR# app has focus, even if the plugin or plugin panel are minimized (thanks Prog)
 
Hope it works well for all of you.
Thank you for this useful plugin!
Here's an idea: Add some On Screen Display (OSD) when a shortcut is detected.
The way to do it is to add a Paint event handler on the spectrum display and just put whatever message you want on the top layer.
The API is already there.

Edward MacDonald
 

Thanks for the suggestion Prog. I have added the OSD as you suggested and the plugin is ready for download on my website.

The OSD is set to only work when the radio is playing. This is because the custom paint event only fires when the spectrum is actively drawn on. This way I do not get my text remaining on the screen when the radio stops.

The text appears immediately when the shortcut key ismpressed and fades out after a few seconds.

Thanks again for your help.



On Fri, Oct 4, 2019, 4:21 AM prog, <info@...> wrote:
On Fri, Oct 4, 2019 at 12:06 PM, Edward MacDonald wrote:
The shortcuts plugin is complete and available for download from my website. 
 
The plugin has been tested with the latest version of SDR#. (I do not guarantee  compatibility with older versions.)
 
There are 33 shortcuts available covering detector types, volume control, zoom control, squelch control, frequency and filter bandwidth controls. Ability to start / stop the  radio, mute audio, etc... 
 
Function keys F1 through F10 control the band selections.
 
For the time being all the shortcut keys are staticly mapped. There is a legend provided in the plugin to view key assignments.
 
I will try and code for user selectable shortcuts at a later date. I have a lot of other coding of older plugins going on and trying to finish the TMate2 controller plugin.
 
If anyone has any suggestions or finds a bug please let me know.
 
The shortcuts work only when the SDR# app has focus, even if the plugin or plugin panel are minimized (thanks Prog)
 
Hope it works well for all of you.
Thank you for this useful plugin!
Here's an idea: Add some On Screen Display (OSD) when a shortcut is detected.
The way to do it is to add a Paint event handler on the spectrum display and just put whatever message you want on the top layer.
The API is already there.

Marco Melandri
 

Hi, @Edward MacDonald,
the shortcut works very well.
On my system, there's only a minor visual defect.
The help button, in "Fluent Dark" theme shown a poorly visible text:


Thanks for the effort developing all of these goodies.

Regards,
Marco

Edward MacDonald
 

Oops forgot about the themes. I will fix later tonight and upload changes. Thanks for letting me know.


On Sat, Oct 5, 2019, 4:34 AM Marco Melandri, <m.melandri@...> wrote:
Hi, @Edward MacDonald,
the shortcut works very well.
On my system, there's only a minor visual defect.
The help button, in "Fluent Dark" theme shown a poorly visible text:


Thanks for the effort developing all of these goodies.

Regards,
Marco

prog
 

On Sat, Oct 5, 2019 at 07:33 PM, Edward MacDonald wrote:
Oops forgot about the themes. I will fix later tonight and upload changes. Thanks for letting me know.
There's a new property with its associated change event: ThemeIsDark.

Edward MacDonald
 

The last version of the SDR# Shortcuts plugin has been released. Current release us ver. 2.1

This release fixes the color of the version text label and the button on the plugin. I also made all the OSD text the same upper case for continuity.

You can download it from my website.



On Sat, Oct 5, 2019, 12:29 PM prog, <info@...> wrote:
On Sat, Oct 5, 2019 at 07:33 PM, Edward MacDonald wrote:
Oops forgot about the themes. I will fix later tonight and upload changes. Thanks for letting me know.
There's a new property with its associated change event: ThemeIsDark.