Author Topic: Managed HotKeys  (Read 36332 times)

0 Members and 1 Guest are viewing this topic.

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #30 on: June 19, 2006, 08:15:25 AM »
Woo Hoo!

Thanks Andy, Glenn, Kerry, Luis, and Mick for all your help and suggestions.

Mark - would it be alright if I direct folks who inquire about HotKeys to TheSwamp, or would you prefer that I host it from my own space?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #31 on: June 23, 2006, 12:09:41 AM »
I feel really badly  :oops:   ... I downloaded the first version and STILL haven't made time to follow up.

Thanks Chuck, you're a real gent' !

Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

nivuahc

  • Guest
Re: Managed HotKeys
« Reply #32 on: June 23, 2006, 07:05:05 AM »
Woo Hoo!

Thanks Andy, Glenn, Kerry, Luis, and Mick for all your help and suggestions.

Mark - would it be alright if I direct folks who inquire about HotKeys to TheSwamp, or would you prefer that I host it from my own space?


Chuck, if you need someplace to host it, I can do that for you if Mark prefer it not be here. If you're talking about pointing people to TheSwamp and this thread, I can't imagine that Mark would have a problem with that, though I cannot speak for him directly. A PM might be in order just to clarify things.

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #33 on: June 23, 2006, 11:15:21 AM »
Kerry - No need to apologize.  You might want to get the last version posted though.  I can guarantee that the first version won't work at all.

Chuck (the other Chuck) - PM sent (for the record).

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #34 on: December 28, 2006, 02:45:41 PM »
Kelie found a bug in the last version of HotKeys that I posted in this thread.  Basically, key combinations that already have some action assigned to them by vanilla AutoCAD would do those actions in addition to whatever commands you assigned to them using HotKeys.  I *think* the attached file will fix the bug.  Please let me know if I am wrong.

FengK

  • Guest
Re: Managed HotKeys
« Reply #35 on: December 28, 2006, 03:21:24 PM »
Problem fixed. Thanks a lot Chuck.

FengK

  • Guest
Re: Managed HotKeys
« Reply #36 on: January 04, 2007, 12:50:58 PM »
Does anyone using Hotkeys (either the .arx or .dll version) also have  this issue:

The Hotkeys are not disabled when there is a dialog (for example Text Edit or Attribute Edit dialog)?

Thanks.

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #37 on: January 04, 2007, 01:28:37 PM »
For those of you playing along at home, the following bit of code (located in HookProcedures.cs) is supposed to prevent the behavior Kelie is experiencing:

Code: [Select]
// Check to see if a modal dialog box is active
// If so, ignore hotkeys
CmdActive cmdActive = (CmdActive)((short)Application.GetSystemVariable("CMDACTIVE"));
if ((cmdActive & CmdActive.CMDACTIVE_DIALOG) == CmdActive.CMDACTIVE_DIALOG)
    return WindowsHook.CallNextHookEx(hHook, code, wParam, lParam);

Latest source code http://home.carolina.rr.com/hotkeys/ManagedHotKeys.zip.

Edit:  Tried to fix the url formatting, but no dice, so I changed it to a raw url.
« Last Edit: January 04, 2007, 01:37:44 PM by Chuck Gabriel »

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #38 on: January 23, 2007, 09:44:06 PM »
Problem solved.  The solution feels kind of kludgy to me (comparing thr first seven letters of the foreground window's caption to the word "AutoCAD"), but it works.

Latest version (binary and source)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #39 on: January 23, 2007, 10:22:01 PM »
Thanks Chuck,

Very timely,
Mark and the boys [17 seats] are swinging over to AC2007 next week.

best regards
Kerry
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

FengK

  • Guest
Re: Managed HotKeys
« Reply #40 on: January 25, 2007, 11:30:13 AM »
Chuck,

Thanks a lot for fixing the problem.  One other issue I'm experiencing is with HotKeyEdit.  With only .NET version installed, when trying to Save the .xml file after making changes, an error message pops up:
Run-time error '35006': The name is not in use for a subkey or named value. Any suggestion how to get around it?  For now, I'm using XML Notepad 2007 to edit the .xml file directly. 

Kerry, did you run into the same problem before?  Thanks.

--
Kelie

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #41 on: January 25, 2007, 01:06:46 PM »
I am aware of that bug and I know the cause, but I just haven't been able to get motivated to fix it.  The problem is that the editor is trying to modify the registry key that HotKeys uses to store the location of the keys file, but it is looking in the wrong location in the registry.  It seems trivial on the surface, but once you dig a little deeper, you start to see that it will actually take significant time and effort to fix.  I just don't know when or if I will get to it, since it isn't a complete show stopper.

I mis-spoke, the problem is actually that the program is looking in the registry to figure out which folder it is installed in, but it is looking in the wrong section of the registry.  I'm looking into a way of fixing it that I hadn't previously considered.  Stay tuned.
« Last Edit: January 25, 2007, 01:23:13 PM by Chuck Gabriel »

Chuck Gabriel

  • Guest
Re: Managed HotKeys
« Reply #42 on: January 25, 2007, 01:51:10 PM »
Looks like it wasn't as big of a deal as I thought.  I was just approaching the problem from the wrong angle.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Managed HotKeys
« Reply #43 on: January 25, 2007, 04:57:00 PM »
......  Any suggestion how to get around it?  For now, I'm using XML Notepad 2007 to edit the .xml file directly. 

Kerry, did you run into the same problem before?  Thanks.

--
Kelie


Hi Kelie
I've/we've used the same XML for a while.  Haven't had an issue though.

Chuck, I recall there had been an issue with Reg keys that we manually edited.
I only have HK for 2006 installed on this box,so can't check ...
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Managed HotKeys
« Reply #44 on: January 25, 2007, 06:13:21 PM »
Chuck, I use something like this to find out where I'm running from:
Code: [Select]
string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string cfgPath = Path.Combine(path, "yourXmlFileNameHere.xml");
...
XmlDocument cfgDoc = new XmlDocument();
cfgDoc.Load(cfgPath);
//Rest of mojo here...

Cheers,
Glenn.

Me