Navigation:  Classes > bKeyCommand >

bKeyCommand:Init()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Creates an object of the class bKeyCommand.

Class

bKeyCommand

Type

Method

Syntax

bKeyCommand{

<bKey | cKey>,

<lAlt>,

<lCtrl>,

<lShift>,

<lExt>,

<oOwner>,

<symCommand>,

[<auArgument>]

} Æ oKeyCommand

Arguments

<bKey>The virtual key code of the key that must be pressed.
Data type:Byte

 

<cKey>The key as string that must be pressed.
Data type:String

 

<lAlt>A logical value that indicates whether additionally also the key ALT must be pressed.
Data type:Logic

 

<lCtrl>A logical value that indicates whether additionally also the key CTRL must be pressed.
Data type:Logic

 

<lShift>A logical value that indicates whether additionally also the key SHIFT must be pressed.
Data type:Logic

 

<lExt>A logical value that indicates whether the key code refers to the numeric key block.
Data type:Logic

 

<oOwner>An object in which the method is to be called, if the key code is pressed.
Data type:Object

 

<symCommand>The name of the method that is to be called in <oOwner>, if the key code is pressed.
Data type:Symbol

 

<auArguments>An array with the arguments that are to be passed to the method <symCommand>.
Data type:Array

Return Value

oKeyCommandThe created object of the class bKeyCommand.
Data type:bKeyCommand

Description

bKeyCommand:Init() creates a new object of the class bKeyCommand and initializes it.

Samples

The following sample defines a keyboard command that is executed if the key combination Ctrl + Delete is pressed. In this case the method Delete() is called to which as parameter a server is passed to:

 

oKeyCommand := bKeyCommand{KEYDELETE,;        // key code

                                                       ,;                                // Alt key

                                                       TRUE,;                        // Ctrl key

                                                       ,;                                // Shift key

                                                       ,;                                // Number block

                                                       oWindow,;                // Owner

                                                       #Delete,;                // Name of the method

                                                       {odbsServer}}        // Argument list

 

The following sample defines a keyboard command that is executed if the key combination Alt + D is pressed. In this case the method Delete() is called to which as parameter a server is passed to:

 

oKeyCommand := bKeyCommand{"D",;                        // key code

                                                       TRUE,;                        // Alt key

                                                       ,;                                // Ctrl key

                                                       ,;                                // Shift key

                                                       ,;                                // Number block

                                                       oWindow,;                // Owner

                                                       #Delete,;                // Name of the method

                                                       {odbsServer}}        // Argument list

See Also

bKeyCommand:ArgumentList

bKeyCommand:Command

bKeyCommand:Owner

 


Page url: http://www.YOURSERVER.com/index.html?bkeycommand_init.htm