遥控器模拟键盘还原成电脑键盘(方法二)

该博客介绍了一种方法,通过模拟键盘输入将遥控器信号转换为计算机键盘操作。主要涉及irsimu_init和irsimu_exit等函数,用于初始化和退出遥控器模拟,并在WM_KEYDOWN和WM_KEYUP消息中处理按键的按下和释放。此外,OnIrMessage函数根据接收到的遥控器信号映射到对应的字母或符号。
摘要由CSDN通过智能技术生成
bool flag;

bool flagletter ;


BOOL CRcsimuDlg::OnInitDialog()
{
CDialog::OnInitDialog();


// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon


irsimu_init( m_hWnd, UM_IR_MESSAGE );


return TRUE;
}


void CRcsimuDlg::OnDestroy() 
{
irsimu_exit();
CDialog::OnDestroy();
}


// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.


void CRcsimuDlg::OnPaint() 
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting


SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);


// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
<

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值