Home Notices Documents Classes Download Others Rice
Classes  >  browser  >  KeyPress(class,string)
browser class : KeyPress(class,string) method

Description

Assigns a handler to the "KeyPress" event.

Syntax

browserInstance.KeyPress(class handleClass, string signature)

Arguments

ClassNameDescription
classhandleClassAn instance with the handler as the member.
stringsignatureSignature of the handler.

Return value

ClassDescription
ehswitchAn instance to control handler execution.

Sample code

Suppose you have the following class definition.

1:

class handle

2:

...

3:

open fitter handle()

4:

// any initialization code...

5:

endfitter

6:

...

7:

open method void handler(domkeyeventargs dkea)

8:

// any handling code....

9:

endmethod

10:

...

11:

endclass

Handler assignment is as follows.

1:

browser b = new browser();

2:

handle h = new handle();

3:

ehswitch ehs = b.KeyPress(h,"handler(domkeyeventargs)");

4:

ehs.Start(); // Starts handling.

Notes

The handler for the "KeyPress" event must be an open method with one argument of the domkeyeventargs class.

In other words, if the method name of the handler is "handlerName", the definition of the handler is as follows.


open method void handlerName(domkeyeventargs dkea)

...

endmethod


In this case, the signature of the handler specify by the second argument is "handlerName(domkeyeventargs)".


This event occurs when the key is pressed. However, this event will not occur when the following keys are pressed.

shift

alt

ctrl

windows

numlock

scrolllock

printscreen


This method is added in Ver 1.0.0.1.

Links for reference

None.

Copyright © Rice All rights reserved.