SilverScreen Solid Modeler

Keys

Keys

Previous topic Next topic  

Keys

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

Keys

 

Structure

An enumeration used by the SilverSharp API routines inchar and nextkey to describe a keyboard or mouse key

 

C# Code

 

  enum Keys

     {

     .

     .

     .

     M_LDOWN,

     M_LUP,

     M_LDOUBLE,

     M_RDOWN,

     M_RUP,

     M_RDOUBLE,

     M_CDOWN,

     M_CUP,

     M_CDOUBLE,

     M_LRDOWN,

     M_LRUP,

     M_LCDOWN,

     M_LCUP,

     M_RCDOWN,

     M_RCUP,

     .

     .

     .

     F1,

     F2,

     F3,

     F4,

     F5,

     F6,

     F7,

     F8,

     F9,

     F10,

     F11,

     F12,

     .

     .

     .

     };

 

 

Members

The symbolic names in the Keys enumeration represent keys and/or various key states. Keys.F1, for instance, indicates the F1 key on the keyboard was pressed. This enumeration is a SilverSharp substitute for the SilverC sskeys.h include file.

 

 

See Also

Enumerations, inchar, nextkey

 

 

Remarks

The inchar and nextkey routines, and by extension the Keys enumeration, are provided to aid in the porting of SilverC, SilverPlus, and SilverEngine code. This mechanism is considered a bad fit for event-driven interfaces like those used in .NET. For an example of a better way to handle keyboard and mouse input, see the SilverSharp WPF sample BirdHouse, Garage, or Othello.

 

 

Example

The following code will wait for the user to press the Escape key before continuing:

 

C# Code

 

 using SilverSharp;

 

 . . .

 

 while ( SC.inchar() != Keys.ESCAPE )

    ;