cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Mapkey entry forced matching and timeout / reading entered mapkeys

functioneer
5-Regular Member

Mapkey entry forced matching and timeout / reading entered mapkeys

I get frustrated when I enter an mapkey incorrectly (either by typing something wrong or having typed a random letter some time before typing the mapkey I intended), wait for the expected action not to happen, then look down to the status bar to look at the mapkey string that I actually typed (which may have disappeared by then), and then have to hit backspace or enter to start over / clean up the mapkey.

 

I would love to force the typed letters to match existing mapkeys in session and timeout after a few seconds. If a mapkey string didn't match an existing mapkey in session, or a few seconds after a letter was typed without completing an existing mapkey in session, the typed letters entry / input string would clear (as if "Enter" was typed).

 

Is there a setting that will prevent typing an incorrect or nonexistent mapkey? Is there a setting that will clear the mapkey entry after a certain timeout period?

 

Alternatively is there a way for a script to read what the current entry / input string of the typed letters? I have created an AutoHotKey script for Creo style mapkeys in Solidworks and NX (and used to work in Creo 3), that has the forced match and timeout features. The script keeps its own database of mapkeys, and uses the search bar to execute commands. However, Creo 7+ no longer shows the necessary information the AHK script needed to interpret mapkey contexts from regular text/number entry contexts. But I'm hopeful there is still a way I can at least read the current Creo mapkey string and have AHK deal with enforcing matches and timeouts.

 

The trail file doesn't seem to be sufficient, as it sometimes captures a typed letter (e.g. ~ Key `main_dlg_cur` `proe_win` 9 821 818 5832825 512 1621 919 1920 1200 526442737 `Y`), but doesn't continue to capture typed letters or backspaces to know the current.

 

Searching google and the forum, I can't find anything related to the settings our logging I'm looking for.

 

I appreciate any help!

5 REPLIES 5

Hi,

in Creo the solution of your problem does not exist.

 

My personal offer ... if you upload your AHK script (packed in zip file) used in Creo 3.0 then I can try to upgrade it for Creo 7.0.


Martin Hanák
functioneer
5-Regular Member
(To:MartinHanak)

I'm sad to hear that you believe the answer doesn't exist. But I can imagine that is the case, as I have searched quite a bit for a solution and tried a number of things, and haven't found anything.

 

I appreciate you looking at the AHK script (attached, with most mapkeys deleted, since the list is long). I've set up the script so that gets the Focused Control ClassNN in order to determine if the keyboard focus is in a text entry area (see CreoInterpretSendType starting in line 401, called from MapKeyScript in line 365)The issue I run into is that AHK can no longer read ClassNN for Creo 7+, so the script can't know when to send regular text vs adjust and then compare the stored mapkey input to mapkey definitions.

 
I was hoping as an alternative, the script could just read what Creo has stored for it's mapkey input, and deal with the forced matching / timeout differently than with it currently does with Solidworks or NX. But what you say makes me think this is a dead end.


@functioneer wrote:

I'm sad to hear that you believe the answer doesn't exist. But I can imagine that is the case, as I have searched quite a bit for a solution and tried a number of things, and haven't found anything.

 

I appreciate you looking at the AHK script (attached, with most mapkeys deleted, since the list is long). I've set up the script so that gets the Focused Control ClassNN in order to determine if the keyboard focus is in a text entry area (see CreoInterpretSendType starting in line 401, called from MapKeyScript in line 365)The issue I run into is that AHK can no longer read ClassNN for Creo 7+, so the script can't know when to send regular text vs adjust and then compare the stored mapkey input to mapkey definitions.

 
I was hoping as an alternative, the script could just read what Creo has stored for it's mapkey input, and deal with the forced matching / timeout differently than with it currently does with Solidworks or NX. But what you say makes me think this is a dead end.

Hi,
 
thank you for sending AHK script. I spent a few minutes examining it. Unfortunately, its code is too complex for me as it includes variants for Creo, Solidworks and Unigraphics. Also I do not understand how it is launched with Creo 3.0
 
I use AutoIt. I ran Au3Info_x64.exe and I tried to see which parts of the Creo window it is able to detect. Unfortunately starting from Creo 4.0 the only one recognized area is main graphic window. Hard to say why the PTC developers redesigned the Creo 4.0 UI so that it behaves  completely different from Creo 3.0.
 
In AutoIt I created simple script and compile it into exe file. This exe file is launched by Creo mapkey.
mapkey ` @SYSTEMstart D:\\PTC\\mytest\\mytest.exe;
This script performs only 2 steps:
1.] activates Creo window with (Active) string in its title
2.] sends "qq" string using Send("qq") command to Creo window ... qq is assigned to my mapkey defined in config.pro
This script works as expected, i.e. runs "qq" mapkey.
 
So it means that it is possible to run mapkey by sending text string to active Creo window. Maybe this information enables you to modify your AHK script for Creo 7.0+
 
I guess it is also possible to develop AutoIt script, which is started by Creo mapkey and performs following steps:
1.] it opens window showing list of all Creo mapkeys -AND- entry field
2.] it activates entry field and enables user to type mapkey name in it
  • during typing script dynamically modifies mapkey list
3.] once there is only one mapkey left in the list, it activates Creo  window and sends mapkey name to it 
 

Martin Hanák
functioneer
5-Regular Member
(To:MartinHanak)

Again, thanks for taking a look at the script, and investigating a bit as well.

 

The AHK script I posted does what you replicated in AutoIT: for creo (as opposed to SW or NX), once the AHK mapkey definition is matched by a user input, it sends keystrokes that match mapkeys defined in config.pro.

 

I appreciate the additional suggestion, however I don't think it will work for our situation. The goal is to try to have all of the CAD software have as similar of workflows as possible, since we use all three for different clients. So while your suggestion would allow the AHK (or AutoIT) script do the forced matching and timeout, it adds another step (the initial creo mapkey) to the workflow to trigger the script. I think I'll just have to use mapkeys as-is for Creo 7+, and give up forced matching and timeouts.

Hi,

I found interesting script on https://www.autoitscript.com/forum/topic/157790-trying-to-make-autocomplete-like-google-search-in-a-text-box/#comment-114418 page. I slightly modify it and tested with Creo 7.0. Its functionality is shown in uploaded video.


Martin Hanák
Announcements
NEW Creo+ Topics: PTC Control Center and Creo+ Portal


Top Tags