Need a routine to simulate a keypress in Microstation

Status
Not open for further replies.

Jeff Goldberg

Usenet Archive
Joined
Jun 28, 2001
Messages
23
Reaction score
0
I need a routine or function that can be called from a basic macro which will simulate a keypress. This function would take an integer argument and return the corresponding ascii character as if it had come from a keypress. This would be used to handle the inputting of data to modal dialog boxes that could otherwise not be written to programmatically.

If such a routine exists, please tell me where I could aquire it. If not, are there any technical reasons why it would not be feasible to develop this routine?

Thanks,

Jeff
 
Hi Jeff,

In a macro use the
"character$ = chr$(asciiValue%)"

It depends upon how you want to use the ascii values...?

If you just want to find out what the values are then I've written a converter to display the corresponding values for your input of either the ASCII number or a character. (Find it, compiled for J7.1, @ www.cadgurus.com (called: "AsciiX.ba))

Regards

Robert M.

"Jeff Goldberg" wrote:

I need a routine or function that can be called from a basic macro which will simulate a keypress. This function would take an integer argument and return the corresponding ascii character as if it had come from a keypress. This would be used to handle the inputting of data to modal dialog boxes that could otherwise not be written to programmatically.

If such a routine exists, please tell me where I could aquire it. If not, are there any technical reasons why it would not be feasible to develop this routine?

Thanks,
...
 
Thanks Robert,

But what I really had in mind was somehow opening the keyboard register as an output device and poking a byte into the register to mimic a true hardware keypress.

Jeff

"Helen Hunter" wrote:
Hi Jeff,

In a macro use the
"character$ = chr$(asciiValue%)"

It depends upon how you want to use the ascii values...?

If you just want to find out what the values are then I've written a converter to display the corresponding values for your input of either the ASCII number or a character. (Find it, compiled for J7.1, @ www.cadgurus.com (called: "AsciiX.ba))

...
 
Hi Jeff,
Sounds like good ol' QuickBASIC...
But this begs the question (in a MicroStation context), what do you really want to accomplish? I tried something similar way-back-when when I was trying to control level symbology (active and reference files) via MicroStation Basic, but the answer turned out to be MDL C expressions called from the macro. Regards, Simon

Jeff Goldberg wrote:
Thanks Robert,

But what I really had in mind was somehow opening the keyboard register as an output device and poking a byte into the register to mimic a true hardware keypress.

Jeff

"Helen Hunter" wrote:
> Hi Jeff,
>
> In a macro use the
...
 
Hi Simon,

The purpose is simple and the versatility would be enormous. This would be the solution to controlling 3rd party applications in which there are dialog boxes with no hooks, and hence, no way to control programmatically.

I've written macros in a different CAD package named OrCAD. What I liked best about OrCAD is that it had an integrated utility for scripting keypresses. Therefore 100% of manual operations performed in OrCAD could also be performed under macro control.

I see Microstation's inability to control all dialog boxes as a serious deficiency. If a keypress application could be written in MDL and called from BASIC, then that would certainly boost Microstation's automation power.

Jeff

Simon Wurster wrote:
Hi Jeff,
Sounds like good ol' QuickBASIC...
But this begs the question (in a MicroStation context), what do you really want to accomplish? I tried something similar way-back-when when I was trying to control level symbology (active and reference files) via MicroStation Basic, but the answer turned out to be MDL C expressions called from the macro. Regards, Simon

Jeff Goldberg wrote:
>
...
 
Status
Not open for further replies.

Latest threads

Back
Top