Skip to main content
1-Visitor
January 12, 2012
Question

Mapkey Logging

  • January 12, 2012
  • 15 replies
  • 3008 views

Does anyone know of a clean way tolog the use of mapkeys? I would like to know if certain mapkeys are being used and how often.

The trail file does not necessarily capture the name of the mapkey depending on which method is used to initiate it (keyed in, menu/icon pick, Mapkey dialog box). I can add the @system to call out a batch file in each mapkey but that causes the system window to flash. It would be great to find a way that doesn't cause an additional window to flash or if there is an additional way to create logging somehow.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

15 replies

12-Amethyst
January 13, 2012
What if you create a seperate batch file containing the logging code then
call that file from the mapkey using the START command. This command has a
run minimized switch.


[ Taken from the START help file]
23-Emerald IV
January 13, 2012
You would still see a quick flash from the original system prompt. Using J-Link (as Steve wrote) would be much cleaner solution … if you’re using J-Link. We are not right now, so the next best solution seems to be to reduce the size of the initial system window before calling the start command to launch the actual logging script (with the /min switch). This way there is just a small flash in the corner instead of the entire screen. Here is what I came up with.

mapkey(continued) @SYSTEM\@echo off\nmode con:cols=15 lines=1\nstart /min \
mapkey(continued) c:\\ptc\\mapkeylog.bat mapkey_name;\

If someone wants to build a J-Link program, I’ll be more than willing to test it. ?

Tom Uminn
Systems Administrator
trans-matic Mfg.
616-820-2499
-<">mailto:->

21-Topaz I
January 13, 2012
Great idea but when the command prompt window starts it starts as the normal size. Then when it sees the mode con command the window changes size.

Plus the /MIN switch does not work in this situation for what ever reason.

Steve G
23-Emerald IV
January 13, 2012
It's working on my machine (Windows 7 - 64bit). I have not tried it on others. The first time it runs it flashes the whole screen. Every time after that it only flashes a small window. Here's a screen shot of the small window (pause was added so I could capture it).

[cid:image002.png@01CCD1E5.8587FEA0]

Tom U.
1-Visitor
January 13, 2012

Thank you for the new ideas. I have some new options to start testing now. Good to see that this may help some others with similar aspirations.