Author Topic: Hotkeys for Bricscad?  (Read 12709 times)

0 Members and 1 Guest are viewing this topic.

hmspe

  • Bull Frog
  • Posts: 325
Hotkeys for Bricscad?
« on: March 07, 2010, 04:37:10 pm »
Has anyone compiled Chuck Gabriel's Hotkeys for Bricscad V10?  If not, can someone provide pointers one what needs to be done to convert the code so it would work in Bricscad? 
"Science is the belief in the ignorance of experts." - Richard Feynman

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #1 on: March 08, 2010, 12:31:26 am »
It probably wouldn't be that hard to do with this http://www.theswamp.org/index.php?topic=29100.0

I never implemented an IExtensionApplication, so you would need to type a command to load things up.

Another method would be to translate Chucks code to C++/CLI and build a mixed managed/unmanaged BRX  :-)

hmspe

  • Bull Frog
  • Posts: 325
Re: Hotkeys for Bricscad?
« Reply #2 on: March 08, 2010, 11:40:40 am »
Daniel,

Thanks for the pointers.  This will be a stretch for me -- my last programming class was C++ for DOS, and I'm not even close to wrapping my head around any of the .NET languages.  My hope here is to work around a problem with GRREAD [the arrow keys return the same values as %, &, (, and ;] until Bricsys gets it fixed.  Ultimately I want to implement an in-place editor for multi-line text expanding on what's in the thread "Text Command Lisp" by CAB started on October 14, 2008.  The lisp side I can handle.  The .NET side, not so much.

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #3 on: March 08, 2010, 08:22:09 pm »
I'll take a look at it in the next couple of days. I've been using this http://www.autohotkey.com/  it works really well

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11653
  • class keyThumper<T>:ILazy<T>
Re: Hotkeys for Bricscad?
« Reply #4 on: March 08, 2010, 08:36:05 pm »

Daniel,
How does autoHotKey behave using the ALT key ... does it interfere with menu mneumonics ??

ie can you use say ALT+E for _ENDP ??
or say ALT+M for _MID ??

I'm a long time user of Chucks HotKeys and not being reliant on binary compatibility every 3 years is a big plus with .NET.
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<--

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #5 on: March 08, 2010, 08:55:34 pm »
Thanks for the endorsement Kerry.

I don't really have anything to add to the discussion, but I would be more than happy to provide anything I can to help the process along.

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #6 on: March 08, 2010, 09:29:53 pm »
works just fine, would be the script
!E::SEND _ENDP{enter}

Autohotkey also has its own scripting language, and is able to compile .EXE that run independently

hmspe

  • Bull Frog
  • Posts: 325
Re: Hotkeys for Bricscad?
« Reply #7 on: March 08, 2010, 09:33:08 pm »
Daniel,

Thanks for looking at this.  I considered AutoHotKeys but in reading through the documentation I didn't come up with an easy and fast way to toggle the conversions on and off in a lisp routine.  For example, for the GRREAD fix the substitution needs to be only for the duration of the GRREAD. 

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #8 on: March 08, 2010, 09:43:27 pm »
Daniel,

Thanks for looking at this.  I considered AutoHotKeys but in reading through the documentation I didn't come up with an easy and fast way to toggle the conversions on and off in a lisp routine.  For example, for the GRREAD fix the substitution needs to be only for the duration of the GRREAD.  

Martin

Sorry, I'm not sure how Autokotkeys will work in your situation. The reason I use it is because it works in all applications, not just CAD.   I do recommend you give it a try though.

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #9 on: March 09, 2010, 04:07:04 am »
a couple of samples

Code: [Select]
;ALT + XXX
!E::send _ENDP{enter}
!M::send _MID{enter}
!C::send _CEN{enter}

;Windows Key + XXX
#e::send (entget(car(entsel)))

;string replacment
::]cdb::AcDbDatabase *pDatabase = acdbHostApplicationServices()->workingDatabase();

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #10 on: March 09, 2010, 04:09:49 am »
need more keys ?

^#e::send control + windows key + E
#!e::send windows key + ALT + E
^!e::send control + ALT + E

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6735
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #11 on: March 09, 2010, 04:50:23 am »
Syntax highlight and intellisense for notepad++ (and others)

hmspe

  • Bull Frog
  • Posts: 325
Re: Hotkeys for Bricscad?
« Reply #12 on: March 09, 2010, 11:47:16 pm »
After reading through the AutoHotKeys documentation I think it might be possible to set an environment variable at the start of the lisp function to match the current window title, then match the environment variable with WinGetTitle in AHK to control whether AHK substitutes for the keys.  Reset the environment variable at the end of the function.  Not sure what to do if the user changes tabs in the middle of the lisp function.  The next step is to see if it works at all....
"Science is the belief in the ignorance of experts." - Richard Feynman

hmspe

  • Bull Frog
  • Posts: 325
Re: Hotkeys for Bricscad?
« Reply #13 on: May 17, 2010, 11:31:33 am »
Follow-up:  AutoHotKeys is not a good solution.  The problem is with MDI.  Getting AHK turned off when changing layout tabs is not a clean process.  The keyboard hook really needs to be thread based, not global.

Chuck, if you are still monitoring this is the original non-managed code still available anywhere?  All the links I've found are dead.

If any of the programmers here are willing to either compile Hotkeys for Bricscad or to edit the code so that it will link to Bricscad I'd still appreciate it. 

Martin
"Science is the belief in the ignorance of experts." - Richard Feynman

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #14 on: May 17, 2010, 01:56:24 pm »
Chuck, if you are still monitoring this is the original non-managed code still available anywhere?  All the links I've found are dead.

Here you go.