.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PaletteSet, use Keyboard when Editor has focus

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Jeff_M
572 Views, 4 Replies

PaletteSet, use Keyboard when Editor has focus

OK, not sure if the Subject says it well, but what I have is a PaletteSet that is displayed during a command in order to show some data as well as containing options for the command. Once it is displayed I set the focus back to the Editor so the user can select objects. When the cursor moves over the Palette focus is automatically switched so the mouse can select the options thereon, then switches back to the Editor as the cursor moves off the Palette. This all works fine & dandy.

 

What I am trying to do is allow the user to use the keyboard to 'press' buttons on the Palette form via a Hotkey approach. The entire time that the Editor has focus, the Editor.GetEntity() method is in use to allow the user to select an object.

Can anyone point me in the right direction for such a task?

 

Thanks!

Jeff_M, also a frequent Swamper
EESignature
4 REPLIES 4
Message 2 of 5
Jeff_M
in reply to: Jeff_M

Well, I've adapted some HotKey code from HERE that almost works. It was written for a Form whereas my form is actually a UserControl on a PaletteSet. So even though the HotKey is defined, I used CTRL + S since I want to save something, when run that key combination does nothing (normally this would bring up the Save Drawing dialog). I think that this is due to the Palette vs Form and I cannot see how to get the WndProc event to fire with the PaletteSet.

 

I will put together a small sample project, hopefully someone can lend a hand.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 5
BlackBox_
in reply to: Jeff_M

FWIW, Jeff - 

 

As I understand it, Civil 3D now 'owns' the Ctrl button for hotkeys, which is why this has never worked for any version of Civil 3D I've used, but will work for vanilla AutoCAD.

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 4 of 5
Jeff_M
in reply to: BlackBox_

That program works for me in C3D2012, including the CTRL key combination.

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 5
Jeff_M
in reply to: Jeff_M

The solution turned out to be simple enough. Instead of using the PaletteSet.Handle to pass to the constructor I used the UserControl.Handle and all works as desired. I posted the sample project to theSwamp's .NET forum.

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost