Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Key event messages
[Messages]

Defines


Define Documentation

#define DEF_APRESS_TIME   1000
 

Default always pressed time of a key.

See also:
MSG_KEYALWAYSPRESS

Definition at line 554 of file window.h.

#define DEF_INTERVAL_TIME   200
 

Default send MSG_KEYLONGPRESS in interval value.

Definition at line 560 of file window.h.

#define DEF_LPRESS_TIME   500
 

Default long pressed time of a key.

See also:
MSG_KEYLONGPRESS

Definition at line 546 of file window.h.

#define MSG_CHAR   0x0011
 

A character translated from MSG_KEYDOWN message.

This message is translated from a MSG_KEYDOWN message by TranslateMessage and sent to the current active window.

 MSG_CHAR
 int ch = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
ch The ASCII code of the pressed key.
key_flags The shift key status when this message occurred.
See also:
MSG_SYSCHAR, TranslateMessage, Macros for key codes and shift status

Definition at line 411 of file window.h.

#define MSG_KEYALWAYSPRESS   0x0018
 

A key is always pressed.

This message is sent when a key is pressed to exceed user-defined always time value.

Definition at line 538 of file window.h.

#define MSG_KEYDOWN   0x0010
 

User presses a key down.

This message is posted to the current active window when the user presses a key down.

 MSG_KEYDOWN
 int scancode = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
scancode The scan code of the pressed key.
key_flags The shift key status when this message occurred.
See also:
MSG_KEYUP, Macros for key codes and shift status
Example:

/*
 * This example trys to handle the event when the user
 * presses <C> key as the <Ctrl> key is down.
 */
int MyWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    switch (message) {
        case MSG_KEYDOWN:
            if (wParam ==SCANCODE_C && lParam & KS_CTRL) {
                // User pressed Ctrl+C.
                break;
            }
            break;
        ...
    }

    return DefaultMainWinProc (hWnd, message, wParam, lParam);
}

Definition at line 391 of file window.h.

#define MSG_KEYLONGPRESS   0x0017
 

A key is long pressed.

This message is sent when a key is pressed exceed user-defined long time value.

Definition at line 529 of file window.h.

#define MSG_KEYSYM   0x0016
 

A key symbol translated from MSG_KEYDOWN messages.

This message is translated from a MSG_KEYDOWN message by TranslateMessage and sent to the current active window.

Note that one translation may generate a key symbol made by more than one character, e.g., when using default keymap, DEL key will generate the key symbol "^[[3~".

 MSG_KEYSYM
 int index = HIBYTE (wParam);
 int keysym = LOBYTE (wParam);
 DWORD key_flags = (DWORD)lParam;

Parameters:
index The index of the key symbol in one translation, zero for a new translation, and the keysym is the first symbol.
keysym The code of the key symbol.
key_flags The shift key status when this message occurred.
See also:
MSG_SYSCHAR, TranslateMessage, Macros for key codes and shift status

Definition at line 518 of file window.h.

#define MSG_KEYUP   0x0012
 

User releases up a key.

This message is posted to the current active window when the user releases up a key.

 MSG_KEYUP
 int scancode = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
scancode The scan code of the released key.
key_flags The shift key status when this message occurred.
See also:
MSG_KEYDOWN, Macros for key codes and shift status

Definition at line 431 of file window.h.

#define MSG_SYSCHAR   0x0014
 

A system character translated from MSG_SYSKEYDOWN message.

This message is translated from a MSG_SYSKEYDOWN message by TranslateMessage and sent to the current active window.

 MSG_SYSCHAR
 int ch = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
ch The ASCII code of the pressed key.
key_flags The shift key status when this message occurred.
See also:
MSG_CHAR, TranslateMessage, Macros for key codes and shift status

Definition at line 471 of file window.h.

#define MSG_SYSKEYDOWN   0x0013
 

User presses down a key when <Alt> key is down.

This message is posted to the current active window when the user presses down a key as <Alt> key is down.

 MSG_SYSKEYDOWN
 int scancode = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
scancode The scan code of the pressed key.
key_flags The shift key status when this message occurred.
See also:
MSG_SYSKEYUP, MSG_SYSCHAR, Macros for key codes and shift status

Definition at line 451 of file window.h.

#define MSG_SYSKEYUP   0x0015
 

User releases up a key when <Alt> key is down.

This message is posted to the current active window when the user releases up a key as <Alt> key is down.

 MSG_SYSKEYUP
 int scancode = (int)wParam;
 DWORD key_flags = (DWORD)lParam;

Parameters:
scancode The scan code of the released key.
key_flags The shift key status when this message occurred.
See also:
MSG_SYSKEYDOWN, Macros for key codes and shift status

Definition at line 491 of file window.h.

#define SetIntervalTime time   ) 
 

Value:

do {                                \
        __mg_interval_time = time;      \
    } while (0)
User set default interval time that MSG_KEYLONGPRESS is sent.

Definition at line 588 of file window.h.

#define SetKeyAlwaysPressTime time   ) 
 

Value:

do {                                \
        __mg_key_alwayspress_time = time; \
    } while (0)
User set default always pressed time of a key.

Definition at line 579 of file window.h.

#define SetKeyLongPressTime time   ) 
 

Value:

do {                                \
        __mg_key_longpress_time = time; \
    } while (0)
User set default long pressed time of a key.

Definition at line 570 of file window.h.


Generated on Mon Jun 26 14:21:39 2006 for MiniGUI V2.0.3 API Reference by  doxygen 1.4.2