Hi Hal,

Hal Vaughan wrote (17-7-2008 21:15)
[...]
Thanks for all the help on this so far. Since I'm almost done, the questions should stop soon and when I finish, I'm going to make them available through whichever sites post these things.
Great, pls let us know.

I've got a couple more questions and both are regarding keypresses.

1) Is there any way that a macro can wait on a keypress without using a prompt or anything like that? For example, the macro may active when F4 is pressed, then wait for the next keypress, find out what key was pressed, and act on that? I've tried looking through API docs, but I'm not sure what I'd use to listen to the keyboard.

Not so much experience with this. But have you looked at this one:
http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Events


2) When I create dialog boxes for Basic, I'm running into a problem with calling macros on events from controls. If I have a push button, I can bind an action to mouse button released and it works fine, but if I also bind it to key released, then it'll call that macro even if I'm just tabbing through the controls -- once tab is released, if that button has focus, the key release macro is called. So far I've gotten around this by creating boolean variables for each button and using two routines, one for key press and one for key up. I set the variable to true on key press and on key up/released I check and if the variable isn't true, I don't execute the bound macro.

Via the UI I bind events to "When initiating". And that works fine for button type Default. So try that one.

Ciao,
Cor

--
"The Year of 3" -2008- "Het jaar van 3"

Cor Nouws - Arnhem - Netherlands
  > marketing contact - http://nl.OpenOffice.org
  > Zeker van OpenOffice.org - www.nouenoff.nl


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to