Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: w32std.h
Link against: N/A

Class TWsEvent

TWsEvent

Support

Supported from 5.0

Description

Window server event.

All events generated by the window server, except redraw events and priority key events, are delivered to the client in a TWsEvent. The client obtains the TWsEvent by calling RWsSession::GetEvent(). The type of data contained in the TWsEvent depends on the type of event. The client can inquire the event type using Type(), and then retrieve the appropriate type of data.

Defined in TWsEvent:
Anonymous, EWsEventDataSize, ErrorMessage(), EventData(), Handle(), Key(), ModifiersChanged(), Pointer(), SetHandle(), SetTimeNow(), SetType(), Time(), Type()


Query event type


Type()

TInt Type() const;

Description

Gets the type of event that occurred.

Return value

TInt

The event type. Event types are defined in TEventCode.

[Top]


Extract pointer, key and modifier changed events


Pointer()

TPointerEvent* Pointer() const;

Description

Gets the pointer event.

This function can be used to get information about the pointer event if Type() returns an event of type EEventPointer. or EEventDragDrop.

Return value

TPointerEvent*

Structure containing pointer event data.


Key()

TKeyEvent* Key() const;

Description

Gets the key event.

This function can be used to get information about the key event if Type() returns an event of type EEventKey, EEventKeyUp or EEventKeyDown.

Return value

TKeyEvent*

Structure containing key event data


ModifiersChanged()

TModifiersChangedEvent* ModifiersChanged() const;

Description

Gets modifier changed event.

This function can be used to get information about the modifier changed event if Type() returns an event of type EEventModifiersChanged.

Return value

TModifiersChangedEvent*

Structure containing modifier changed event data


ErrorMessage()

TWsErrorMessage* ErrorMessage() const;

Description

Gets an error event.

This function can be used to get information about the error event if Type() returns an event of type EEventErrorMessage.

Return value

TWsErrorMessage

The error event.

[Top]


Getting event data


Handle()

TUint Handle() const;

Description

Gets the window handle.

This is the handle that was passed to the window's Construct() function: typically it will be a pointer to the client-side object owning the window, providing access to its member functions.

Return value

TUint

The window handle.


Time()

TTime Time() const;

Description

Gets the time when the event occurred.

Return value

Ttime

The time when the event occurred.

[Top]


Setting event data


SetType()

void SetType(TInt aType);

Description

Sets event type.

Parameters

TInt aType

The event type. Event types are defined in TEventCode.


SetHandle()

void SetHandle(TUint aHandle);

Description

Sets the event handle.

This is the client handle of the window that is being sent the event.

Parameters

TUint aHandle

The event handle.


SetTimeNow()

void SetTimeNow();

Description

Sets the event time to current time.


EventData()

TUint8* EventData() const;

Description

Gets information about the event.

This function gives you direct access to the event data as a whole. The event can be a keyboard or pen event or it could be a new special event that only you and another application know about. You are limited to EWsEventDataSize bytes worth of data.

Return value

TUint8*

A pointer to the event data.

[Top]


Enumerations


Enum Anonymous

Anonymous

Description

Event data size.

EWsEventDataSize

The size of a TPointer event. This is the maximum number of bytes worth of data that can be returned by EventData(). Note: Currently this size is 6 bytes.