📄 vk_map.c
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
//------------------------------------------------------------------------------
//
// File: vk_map.c
//
// This file containts definition for keyboard row/columnt to virtual key
// mapping.
//
#include <windows.h>
#include <winuserm.h>
#include <keypad.h>
#ifndef dimof
#define dimof(x) (sizeof(x)/sizeof(x[0]))
#endif
//------------------------------------------------------------------------------
const UCHAR g_keypadVK[KEYPAD_ROWS * KEYPAD_COLUMNS] = {
// R0/R4 R1/R5 R2/R6 R3/R7
VK_THOME, VK_T1, VK_T4, VK_T7, // C0
VK_TSTAR, VK_APP4, 0, 0,
VK_TBACK, VK_T2, VK_T5, VK_T8, // C1
VK_T0, 0, 0, 0,
VK_TSOFT1, VK_T3, VK_T6, VK_T9, // C2
VK_TPOUND, 0, 0, 0,
VK_TSOFT2, VK_TTALK, VK_TEND, VK_TVOLUMEDOWN, // C3
VK_TVOLUMEUP, VK_TRECORD, 0, 0,
VK_TUP, VK_TRIGHT, VK_TLEFT, VK_TDOWN, // C4
VK_TACTION, 0, 0, 0,
0, 0, 0, 0, // C5
0, 0, 0, 0,
0, 0, 0, 0, // C6
0, 0, 0, 0,
0, 0, 0, 0, // C7
0, 0, 0, 0
};
//------------------------------------------------------------------------------
static const UCHAR off[] = { VK_APP4 };
static const UCHAR keylock[] = { VK_TEND };
static const UCHAR speaker[] = { VK_TTALK };
static const KEYPAD_REMAP_ITEM remapItems[] = {
{ VK_TPOWER, dimof(off), 3000, off },
{ VK_APP6, dimof(keylock), 3000, keylock },
{ VK_F16, dimof(speaker), 3000, speaker }
};
const KEYPAD_REMAP g_keypadRemap = { dimof(remapItems), remapItems };
//------------------------------------------------------------------------------
static const UCHAR softkeys[] = { VK_TSOFT1, VK_TSOFT2 };
static const KEYPAD_REPEAT_BLOCK softkeyBlock = { dimof(softkeys), softkeys };
static const KEYPAD_REPEAT_ITEM repeatItems[] = {
{ VK_T0, 500, 500, TRUE, NULL },
{ VK_T1, 500, 500, TRUE, NULL },
{ VK_T2, 500, 500, TRUE, NULL },
{ VK_T3, 500, 500, TRUE, NULL },
{ VK_T4, 500, 500, TRUE, NULL },
{ VK_T5, 500, 500, TRUE, NULL },
{ VK_T6, 500, 500, TRUE, NULL },
{ VK_T7, 500, 500, TRUE, NULL },
{ VK_T8, 500, 500, TRUE, NULL },
{ VK_T9, 500, 500, TRUE, NULL },
{ VK_TPOUND, 100, 100, TRUE, NULL },
{ VK_TSTAR, 100, 100, TRUE, NULL },
{ VK_TACTION, 400, 200, FALSE, &softkeyBlock },
{ VK_TBACK, 400, 200, FALSE, NULL },
{ VK_TUP, 400, 200, FALSE, &softkeyBlock },
{ VK_TRIGHT, 400, 200, FALSE, &softkeyBlock },
{ VK_TLEFT, 400, 200, FALSE, &softkeyBlock },
{ VK_TDOWN, 400, 200, FALSE, &softkeyBlock }
};
const KEYPAD_REPEAT g_keypadRepeat = { dimof(repeatItems), repeatItems };
//------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -