Exemplo n.º 1
0
/// Check whether or not a combination key should be used.
bool kKeyboard::kIsUseCombinedCode(BYTE bScanCode)
{
    BYTE bDownScanCode;
    bool bUseCombinedKey = false;
    
    bDownScanCode = bScanCode & 0x7F;
    
    // If the key is an alphabet,
    // it is affected by Shift or CAPS lock.
    if (kIsAlphabetScanCode(bDownScanCode) == true)
    {
        // If Shift or CAPS lock is pushed before,
        // return a combination key.
        if (bShiftDown ^ bCapsLockOn)
        {
            bUseCombinedKey = true;
        }
        else
        {
            bUseCombinedKey = false;
        }
    }
    // If the key is a number or symbol
    // it is affected by shift.
    else if (kIsNumberOrSymbolScanCode(bDownScanCode) == true)
    {
        // If shift key is pused before
        // return a combination key.
        if (bShiftDown == true)
        {
            bUseCombinedKey = true;
        }
        else
        {
            bUseCombinedKey = false;
        }
    }
    // If the key is from a number pad,
    // it is affected by Num Lock.
    // Except for 0xE0, entended key and number pad are overlapped,
    // return a combination code when extended key is nor received.
    else if ((kIsNumberPadScanCode(bDownScanCode) == true) &&
            (bExtendedCodeIn == false))
    {
        // If Num lock is pused before,
        // return a combination key.
        if (bNumLockOn == true)
        {
            bUseCombinedKey = true;
        }
        else
        {
            bUseCombinedKey = false;
        }
    }
    
    return bUseCombinedKey;
}
Exemplo n.º 2
0
/**
 *  조합된 키 값을 사용해야 하는지 여부를 반환
 */
BOOL kIsUseCombinedCode( BOOL bScanCode )
{
    BYTE bDownScanCode;
    BOOL bUseCombinedKey;
    
    bDownScanCode = bScanCode & 0x7F;
    
    // 알파벳 키라면 Shift 키와 Caps Lock의 영향을 받음
    if( kIsAlphabetScanCode( bDownScanCode ) == TRUE )
    {
        // 만약 Shift 키와 Caps Lock 키 중에 하나만 눌러져있으면 조합된 키를 되돌려 줌
        if( gs_stKeyboardManager.bShiftDown ^ gs_stKeyboardManager.bCapsLockOn )
        {
            bUseCombinedKey = TRUE;
        }
        else
        {
            bUseCombinedKey = FALSE;
        }
    }
    // 숫자와 기호 키라면 Shift 키의 영향을 받음
    else if( kIsNumberOrSymbolScanCode( bDownScanCode ) == TRUE )
    {
        // Shift 키가 눌러져있으면 조합된 키를 되돌려 줌
        if( gs_stKeyboardManager.bShiftDown == TRUE )
        {
            bUseCombinedKey = TRUE;
        }
        else
        {
            bUseCombinedKey = FALSE;
        }
    }
    // 숫자 패드 키라면 Num Lock 키의 영향을 받음
    // 0xE0만 제외하면 확장 키 코드와 숫자 패드의 코드가 겹치므로, 
    // 확장 키 코드가 수신되지 않았을 때만처리 조합된 코드 사용
    else if( ( kIsNumberPadScanCode( bDownScanCode ) == TRUE ) && 
             ( gs_stKeyboardManager.bExtendedCodeIn == FALSE ) )
    {
        // Num Lock 키가 눌러져있으면, 조합된 키를 되돌려 줌
        if( gs_stKeyboardManager.bNumLockOn == TRUE )
        {
            bUseCombinedKey = TRUE;
        }
        else
        {
            bUseCombinedKey = FALSE;
        }
    }

    return bUseCombinedKey;
}
Exemplo n.º 3
0
BOOL kIsUseCombinedCode( BYTE bScanCode )
{
	BYTE bDownScanCode;
	BOOL bUseCombinedKey = FALSE;

	bDownScanCode = bScanCode & 0x7F;

	if( kIsAlphabetScanCode(bDownScanCode) )
	{
		// shift나 capslock이 눌러져 있다면,
		if( gs_stKeyboardManager.bShiftDown ^ gs_stKeyboardManager.bCapsLockOn )
		{
			bUseCombinedKey = TRUE;
		}
		else
		{
			bUseCombinedKey = FALSE;
		}
	}
	//숫자나 기호는 쉬프트의 영향을 받음
	else if( kIsNumberOrSymbolScanCode( bDownScanCode ) )
	{
		if( gs_stKeyboardManager.bShiftDown == TRUE )
		{
			bUseCombinedKey = TRUE;
		}
		else
		{
			bUseCombinedKey = FALSE;
		}
	}
	// 숫자패드 키라면 Num Lock 키의 영향을 받음  즉, 일반 숫자패드 키더라도 NumLock이 되어있으면 일반 숫자키
	else if( ( kIsNumberPadScanCode(bDownScanCode) == TRUE ) && (gs_stKeyboardManager.bExtendedCodeIn == FALSE) )
	{
		if( gs_stKeyboardManager.bNumLockOn == TRUE )
		{
			bUseCombinedKey = TRUE;
		}
		else
		{
			bUseCombinedKey = FALSE;
		}
	}
	return bUseCombinedKey;
}