BInputServerMethod

Derived From:BInputServerFilter
Mix-in Classes:
Declared In:add-ons/input_server/InputServerMethod.h
Library:libbe.so
Allocation:By the Input Server only
Class Overview

Constructor and Destructor

BInputServerMethod()

BInputServerMethod(const char* name,
                   const uchar* icon);

Creates a new BInputServerMethod object. You can initialize the object—set initial values, spawn threads, etc.—either here or in the inherited function InitCheck() function, which is called immediately after the constructor.

name is a textual name describing the input method, and icon is the raw data for a 16x16 8-bit icon built from the standard BeOS palette. This name and icon will be displayed in the input method menu (the little keyboard icon in the Deskbar). When the user selects your input method from the menu, your MethodActivated() function is called.

~BInputServerMethod()

BInputServerMethod();

Deletes the BInputServerMethod object. The destructor is invoked by the Input Server only—you never delete a BInputServerMethod object from your own code. If this object has spawned its own threads or allocated memory on the heap, it must clean up after itself here.


Hook Functions

MethodActivated()

virtual status_t MethodActivated(bool active);

The MethodActivated() hook function is invoked by the Input Server when the user activates your input method (active is true) or deactivates it (active is false). This is your chance to activate any helper threads or loopers to the fact that you'll be handling input events soon.

Return B_OK if that's OK, or something else if it's not. The default implementation returns B_OK.


Member Functions

EnqueueMessage()

status_t EnqueueMessage(BMessagemessage);

Inserts the specified message into the Input Server's event queue; the message continues down-stream from this point, passing through additional active input methods and input filters on its way to the App Server.

SetName()

status_t SetName(const char* name);

Changes your input method's name, as found in the input method menu of the Deskbar.

The Input Server makes a copy of name.

SetIcon()

status_t SetIcon(const uchar* icon);

Changes your input method's icon, as found in the input method menu of the Deskbar. icon should be raw data for a 16x16 8-bit icon built from the standard BeOS palette.

The Input Server makes a copy of icon.

SetMenu()

status_t SetMenu(const BMenumenu,
                 const BMessenger target);

Lets you assign a menu to your input method's entry in the input method menu of the Deskbar. Messages generated by the menu are sent to target.

Passing a NULL menu disables your input method's menu.

You retain ownership of menu; be careful not to delete it while the Input Server is still using it.

Creative Commons License
Legal Notice
This work is licensed under a Creative Commons Attribution-Non commercial-No Derivative Works 3.0 License.