Simulate press and release of keys necessary to 'type' the specified character.


First available in version 3.0 build 2039.

Input Parameters:

hwnd - Handle of window where the character should be sent. If the hwnd is 0, the character will be sent to the window that has the input focus. If the hwnd is not 0, the specified window will become the foreground window before the character is sent.

char - A single character to be sent. Note that 'A' is different from 'a', SWF Studio will figure out which virtual key codes are required to send the correct character.

Output Parameters:

No output parameters.

Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Keyboard.sendChar( paramsObject [, callbackParamsObject] [, errorParamsObject] );

Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Keyboard.sendChar( paramsObject );




The following example receives a window handle for an application to which we will send the characters H, e, l, l, and o.

function sayHello(hwnd)
    ssCore.Keyboard.sendChar({hwnd:hwnd, char:"H"});
    ssCore.Keyboard.sendChar({hwnd:hwnd, char:"e"});
    ssCore.Keyboard.sendChar({hwnd:hwnd, char:"l"});
    ssCore.Keyboard.sendChar({hwnd:hwnd, char:"l"});
    ssCore.Keyboard.sendChar({hwnd:hwnd, char:"o"});