On Sat, Oct 10, 2009 at 9:26 AM, Wolfgang Westphal
<[email protected]> wrote:
> I would like to capture a pressed right control key whithout any
> other key beeing pressed.
> I.ve already tried the SYSGETKEY Utility, but it didn't do the trick.
You can do this on Windows with an ooDialog dialog, but I don't think
it is possible in a command line program.
Plus it will only capture the key press when the dialog has the focus.
Probably not what you want. But, here is a working example:
/* Dialog that captures the Control key keypress event. */
dlg = .ControlKey~new
if dlg~initCode = 0 then do
dlg~createCenter(170, 90, "Show Control Key Event", -
"VISIBLE MAXIMIZEBOX MINIMIZEBOX")
dlg~execute("SHOWTOP", IDI_DLG_OOREXX)
dlg~deinstall
end
-- End of entry point.
::requires "OODWin32.cls"
::requires "WinSystm.cls"
::class 'ControlKey' subclass UserDialog -
inherit AdvancedControls VirtualKeyCodes
::constant CtrlKey 17
::method defineDialog
self~addButton(IDOK, 130, 70, 35, 15, "Quit")
::method initDialog
self~connectKeyPress(onCtrl, self~CtrlKey)
::method onCtrl
use arg key, shift, control, alt, info
say 'Key press:' key 'shift?' shift 'control?' control || -
' alt?' alt 'extra info:' info
Here's some output:
C:\work.ooRexx>captureCtrlKey.rex
Key press: 17 shift? 0 control? 1 alt? 0 extra info: numOn capsOff
rControl scrollOff
Key press: 17 shift? 0 control? 1 alt? 0 extra info: numOn capsOff
lControl scrollOff
C:\work.ooRexx>
By the way, Ven if you're reading this - it is also an example of
providing minimize and maximize buttons.
--
Mark Miesfeld
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users