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

0 Members and 1 Guest are viewing this topic.

hmspe

  • Bull Frog
  • Posts: 324
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: 6723
  • 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: 324
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: 6723
  • 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: 6723
  • 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: 324
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: 6723
  • 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: 6723
  • 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: 6723
  • 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: 6723
  • 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: 324
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: 324
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.

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #15 on: May 17, 2010, 05:29:37 pm »
Thank you.
"Science is the belief in the ignorance of experts." - Richard Feynman

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #16 on: May 18, 2010, 03:53:25 am »
Chuck, did you write all that?

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #17 on: May 18, 2010, 07:59:12 am »
Chuck, did you write all that?

Yep.  Are you adding points or taking them away? :-)

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #18 on: May 18, 2010, 08:25:41 am »
Adding! As always, your coding is exceptional   8-)

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #19 on: May 18, 2010, 09:12:44 am »
Thanks.  Right back atcha.

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #20 on: May 18, 2010, 09:43:15 am »
Would you mind if I port this to BRX / Bricscad? I think I would need to setup a new project and I may need to ask you a question or two.

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #21 on: May 18, 2010, 10:13:02 am »
I think that would be great.  Ask away.  I'll do my best.

LE3

  • Guest
Re: Hotkeys for Bricscad?
« Reply #22 on: May 18, 2010, 12:24:13 pm »
Adding! As always, your coding is exceptional   8-)
Do not know why Chuck is not working for any of the big software companies... he writes excellent code! - cheers.

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #23 on: May 18, 2010, 12:36:14 pm »
Thanks Luis, but Chuck doesn't have the right pieces of paper, for starters.  It certainly isn't for lack of trying. 
I start work on my BS in Computer Science next Monday, though.

LE3

  • Guest
Re: Hotkeys for Bricscad?
« Reply #24 on: May 18, 2010, 12:49:25 pm »
Thanks Luis, but Chuck doesn't have the right pieces of paper, for starters.  It certainly isn't for lack of trying.  
I start work on my BS in Computer Science next Monday, though.
Excellent move, go for it!

« Last Edit: May 18, 2010, 02:38:58 pm by LE3 »

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #25 on: May 19, 2010, 12:55:57 pm »
Beta 1 for Bricscad V10 

@ Chuck, All I really needed to do was convert the project to Unicode and add a line for demand loading. 

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #26 on: May 19, 2010, 01:49:23 pm »
Beta 1 for Bricscad V10 

@ Chuck, All I really needed to do was convert the project to Unicode and add a line for demand loading. 


Awesome.

Daniel Eiszele

  • Newt
  • Posts: 85
Re: Hotkeys for Bricscad?
« Reply #27 on: May 19, 2010, 07:31:43 pm »
Just in case anyone else was looking and couldn't find them.  I pulled these out of the source code.  Does anyone know if there is a command to list the functions available in an arx file?

Commands are:

Keyson - Turns hotkeys on.
Keysoff - Turns hotkeys off.
KeysToggle - Off to On; On to Off
Keys Config - Shows Configuration Dialog
GetKeys - Lists current key mappings and commands they are bound to.
EditKeys - Loads the Hotkeys editor (Currently doesn't exist?????) 

By the way, great program Chuck.  This is one of those didn't know I needed it till I had it programs.  And thanks Daniel for doing the compilation for Bricscad.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11653
  • class keyThumper<T>:ILazy<T>
Re: Hotkeys for Bricscad?
« Reply #28 on: May 19, 2010, 10:22:56 pm »

From memory, the EditKeys was a COM program, not ARX.


Daniel, with the version I compiled I added an initialise function that printed the command names to the screen ... was going to write a KeysHelp routine but never got around to it.
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 #29 on: May 19, 2010, 10:23:24 pm »
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #30 on: May 19, 2010, 10:37:48 pm »
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.



That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...

Chuck Gabriel

  • Guest
Re: Hotkeys for Bricscad?
« Reply #31 on: May 19, 2010, 11:47:36 pm »
Thanks for the kind words.

The HotKeys editor is a stand-alone VB6 program.  I can post a copy here if you like.



That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...


Here it is.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11653
  • class keyThumper<T>:ILazy<T>
Re: Hotkeys for Bricscad?
« Reply #32 on: May 20, 2010, 12:26:45 am »

That would be great so I can get an idea of what it does, then maybe I could write up something in MFC so it's all in a single module.

@Kerry, I can add that, or add a menu...


Piccys and the file ...

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<--

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #33 on: June 30, 2012, 12:04:27 pm »
Picking up an old thread.  I thought I'd try compiling this version of HotKeys for Bricscad 12.  I'm using Visual C++ Express Edition, which I know very little about.  My last experience with C++ was in DOS about 18 years ago.  Working in VS is a lot different from the Borland IDE.  In any case, I get the following when I try a build:

1>Compiling...
1>StdAfx.cpp
1>t:\2012 work\063012 hotkeys\hotkeys\hotkeys\source\StdAfx.h(29) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.30729
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>BSCMAKE: error BK1506 : cannot open file '.\Release\HookProcedures.sbr': No such file or directory
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BRX10)

I think a lot of the problem is that I don't know where or how to point to the SDK.  Is there a tutorial that tells, on a very basic level, how to set up and compile an existing project for BRX?  Everything I've found so far assumes that "compile with the new SDK" is all the instruction anyone would need.  I need something more like a step by step.  Any help on getting started would be greatly appreciated.  If someone is willing to do a build for BC12 that would be good, too.   

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

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #34 on: June 30, 2012, 10:36:32 pm »
Apparently afxwin.h is not included in the Visual C++ Express Edition.  I guess my question needs to change to ask whether it is necessary here, and if not how to remove any references.
"Science is the belief in the ignorance of experts." - Richard Feynman

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #35 on: July 11, 2012, 11:39:57 pm »
heres a new build for V12  :-)

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #36 on: July 12, 2012, 01:44:46 pm »
Thanks.
"Science is the belief in the ignorance of experts." - Richard Feynman

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #37 on: February 03, 2016, 06:10:15 pm »
I was trying to compile this for Bricscad v16.2 and a fatal error C1189 -- "#error:  MFC does not support NTDDI_VERSION less than NTDDI_WINXP.  Please change the definition of NTDDI_VERSION in your project properties or precompiled header."

I'm still in over my head when it comes to .arx programming.  Can anyone provide pointers on what to look for and where?  "NTDDI_VERSION" does not show up in any of the source. 

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

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6723
  • AKA Daniel
Re: Hotkeys for Bricscad?
« Reply #38 on: February 03, 2016, 07:50:44 pm »
For BricsCADv16 32 and 64 bit, I only tested that they load (x64) anyway  :crazy2:
« Last Edit: February 03, 2016, 08:04:30 pm by nullptr »

hmspe

  • Bull Frog
  • Posts: 324
Re: Hotkeys for Bricscad?
« Reply #39 on: February 03, 2016, 10:23:51 pm »
Thanks.
"Science is the belief in the ignorance of experts." - Richard Feynman