C++如何禁用全局键盘钩子或者程序钩子?( 四 )


else if (Key == VK_F7)
= "[F7]";
else if (Key == VK_F8)
= "[F8]";
else if (Key == VK_F9)
= "[F9]";
else if (Key == )
= "[F10]";
else if (Key == )
= "[F11]";
else if (Key == )
= "[F12]";
Else if (Key == VK快照)//打印屏幕 。
= "[PRS CrN]";
Else if (Key == VK滚动)//滚动锁定
= "[ Lock]";
Else if(Key = = VK _暂停)//暂停,中断
= "[Pause]";
Else if (Key == VK大写)//大写锁定
= "[Caps Lock]";
// - //
//控制键
Else if (Key == 8) //-退格键
= "[back space]";
Else if (Key == ) //回车键,换行 。
= "[Enter]\ n ";
(key = = vk _ space)/空格
密钥串=
//Shift键:键盘录音时,不需要录音 。单个班次不会有任何字符,
Shift键与其他键组合来输出字符 。
/*
Else if (Key == ) //向左键移动 。
= "[Shift]";
Else if (Key == ) //向右键移动 。
= "[SHIFT]";
*/
/*如果只记录键盘输入的字母:下列键可能不会输出到文件*/
Else if (Key == ) // tab键
= "[Tab]";
Else if(Key = = VK控制)//左控制键
= "[Ctrl]";
Else if(Key = = VK遥控)//右控制键
= "[CTRL]";
Else if(Key = = VK菜单)//移动左键
= "[Alt]";
Else if(Key = = VK菜单)//向右移动键 。
= "[ALT]";
Else if (Key == ) //右键
= "[Win]";
Else if (Key == ) //右窗口键
= "[WIN]";
Else if (Key == VK应用程序)//右击键盘 。
= "右键单击";
Else if(Key = = VK _插入)//插入
= "[]";
Else if(Key = = VK _删除)//删除
= "[]";
Else if (Key == ) // Start
= "[Home]";
否则if (Key == ) // End 。
= "[End]";
Else if (Key == ) //上一页
= "[PgUp]";
Else if (Key == ) //下一页
= "[pg down]";
//几个不常用的键:一般键盘没有 。
Else if(Key = = VK _取消)//取消
= "[]";
Else if (Key == ) //清除
= "[Clear]";
Else if (Key == VK选择)//选择
= "[]";
Else if(Key = = VK _ PRINT)//打印
= "[Print]";
Else if(Key = = VK _ )//执行
= "[]";
// - //
Else if(Key = = VK _左)//上、下、左、右 。
= "[←]";
Else if(Key = = VK _右)
= "[→]";
else if (Key == VK_UP)
= "[↑]";
Else if (Key == VK向下)
= "[↓]";
Else if(Key = = VK _数字锁)//键盘数字锁
= "[]";
Else if (Key == ) //加减乘除 。
= "+";
else if (Key == VK_SU *** RACT)
= "-";
Else if (Key == VK乘法)
= " *
Else if(Key = = VK _除)
= "/";
else if(Key = = 190 | | Key = = 110)// .和一个键盘 。
= ",";
//键盘数字键:0-9
else if (Key == )
= " 0
else if (Key == )
= " 1
else if (Key == )
= " 2
else if (Key == )
= " 3
else if (Key == )
= " 4
else if (Key == )
= " 5
else if (Key == )
= " 6
Else if(Key = = VK数字键盘7)
= " 7
Else if(Key = = VK数字键盘8)
= " 8
Else if(Key = = VK数字键盘9)
= " 9
// - //
// - //
//*判断字母大小写*//
Else if (Key =97 Key = 122) //字母:a-z
{
If(get (vk _ ))//大写锁定

C++如何禁用全局键盘钩子或者程序钩子?

文章插图
{
If(IS) //Shift键:小写字母 。
= Key
Else //仅大写锁定:输出大写字母 。
密钥串= Key-32;
}
Else//大写不锁定 。
{
如果(为)//按Shift键:大写字母 。
密钥串= Key-32;
Else // Shift键未按下:小写字母