Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reassign keyboard shortcuts?

Status
Not open for further replies.

plagoon

Technical User
Mar 17, 2005
9
US
I'd like to know how to reassign keyboard shortcuts in Paradox 10. It's almost identical to earlier versions, and some of the keyboard assignments are antiquated -- e.g., Ctrl+Z.

It's an obvious issue, I've spent hours on it -- I think the answer has something to do with PAL.

I'd especially like to change the keyboard shortcuts that are used when editing a memo field.

Any ideas would be much appreciated!
 
Trap for the keyphysical event of the key you want to change, and activate your own.

At form level keyphysical.
Code:
method keyPhysical(var eventInfo KeyEvent)

	if eventInfo.isPreFilter() then
		;// This code executes for each object on the form

the message() is included to help figure out the codes to capture.  Uncomment the next line while developing
;    message("Code: "+strng(eventinfo.vcharcode()))
  switch
    case (eventinfo.iscontrolkeydown() and eventinfo.vcharcode()=90) :
    disabledefault
    msginfo("Caught","Caught Ctrl-Z")

  endswitch

	else
		;// This code executes only for the form

	endIf

endMethod

Tony McGuire
"It's not about having enough time. It's about priorities.
 
THANKS! But I don't know how to implement this.

I tried creating a script, kind of like a "startup script" that I would run every time Paradox opens.

I get the error "Unknown Identifier" at the first line:

[tt] method keyPhysical(var eventInfo KeyEvent) [/tt]

If I eliminate the lines the Script Editor inserts by default:

[tt]method run(var eventInfo Event)

endMethod[/tt]

then I get the error "Cannot change built-in header"

I'm not interested in writing something for a specific table or form, I'd like to change the keyboard globally (for the session).

Help!
 
Well, you can try to find a Windows utility that traps for keystrokes, and see if it intercepts them before Paradox sees them.

But the code I gave you, modified for specific issues perhaps, is the only way to do this in Paradox.

There is no 'global' keystroke replacement method for Paradox. It is 'form by form' only.

Let us know if you are successful.


Tony McGuire
"It's not about having enough time. It's about priorities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top