本文整理汇总了C++中HID_MOUSE_UpdatePosition函数的典型用法代码示例。如果您正苦于以下问题:C++ HID_MOUSE_UpdatePosition函数的具体用法?C++ HID_MOUSE_UpdatePosition怎么用?C++ HID_MOUSE_UpdatePosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HID_MOUSE_UpdatePosition函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USR_MOUSE_ProcessData
/**
* @brief USR_MOUSE_ProcessData
* Process Mouse data
* @param data : Mouse data to be displayed
* @retval None
*/
void USR_MOUSE_ProcessData(HID_MOUSE_Data_TypeDef *data)
{
uint8_t idx = 1;
static uint8_t b_state[3] = { 0, 0 , 0};
if ((data->x != 0) && (data->y != 0))
{
HID_MOUSE_UpdatePosition(data->x , data->y);
}
for ( idx = 0 ; idx < 3 ; idx ++)
{
if(data->button & 1 << idx)
{
if(b_state[idx] == 0)
{
HID_MOUSE_ButtonPressed (idx);
b_state[idx] = 1;
}
}
else
{
if(b_state[idx] == 1)
{
HID_MOUSE_ButtonReleased (idx);
b_state[idx] = 0;
}
}
}
}
示例2: USR_MOUSE_ProcessData
/**
* @brief Processes Mouse data.
* @param data: Mouse data to be displayed
* @retval None
*/
void USR_MOUSE_ProcessData(HID_MOUSE_Info_TypeDef *data)
{
if((data->x != 0) && (data->y != 0))
{
HID_MOUSE_UpdatePosition(data->x , data->y);
}
}
示例3: HID_MouseMenuProcess
/**
* @brief Manages Mouse Menu Process.
* @param None
* @retval None
*/
void HID_MouseMenuProcess(void)
{
if(hid_demo.mouse_state == HID_MOUSE_START)
{
LCD_LOG_ClearTextZone();
BSP_LCD_ClearStringLine(19);
USBH_HID_MouseInit(&hUSBHost);
USR_MOUSE_Init();
HID_MOUSE_UpdatePosition(0,0);
}
}
示例4: HID_MouseMenuProcess
/**
* @brief Manages Mouse Menu Process.
* @param None
* @retval None
*/
void HID_MouseMenuProcess(void)
{
switch(hid_demo.mouse_state)
{
case HID_MOUSE_IDLE:
hid_demo.mouse_state = HID_MOUSE_START;
HID_SelectItem(DEMO_MOUSE_menu, 0);
hid_demo.select = 0;
prev_select = 0;
break;
case HID_MOUSE_WAIT:
if(hid_demo.select != prev_select)
{
prev_select = hid_demo.select ;
HID_SelectItem(DEMO_MOUSE_menu, hid_demo.select & 0x7F);
/* Handle select item */
if(hid_demo.select & 0x80)
{
switch(hid_demo.select & 0x7F)
{
case 0:
hid_demo.mouse_state = HID_MOUSE_START;
break;
case 1: /* Return */
LCD_LOG_ClearTextZone();
hid_demo.state = HID_DEMO_REENUMERATE;
hid_demo.select = 0;
break;
default:
break;
}
}
}
break;
case HID_MOUSE_START:
USBH_HID_MouseInit(&hUSBHost);
USR_MOUSE_Init();
hid_demo.mouse_state = HID_MOUSE_WAIT;
HID_MOUSE_UpdatePosition(0,0);
break;
default:
break;
}
hid_demo.select &= 0x7F;
}
示例5: HID_MouseMenuProcess
/**
* @brief Manages Mouse Menu Process.
* @param None
* @retval None
*/
void HID_MouseMenuProcess(void)
{
switch(demo.mouse_state)
{
case HID_MOUSE_IDLE:
demo.mouse_state = HID_MOUSE_START;
Demo_SelectItem(DEMO_MOUSE_menu, 0);
demo.select = 0;
break;
case HID_MOUSE_WAIT:
if(demo.select != prev_select)
{
prev_select = demo.select;
Demo_SelectItem(DEMO_MOUSE_menu, demo.select & 0x7F);
/* Handle select item */
if(demo.select & 0x80)
{
demo.select &= 0x7F;
switch(demo.select)
{
case 0:
demo.mouse_state = HID_MOUSE_START;
break;
case 1: /* Return */
LCD_LOG_ClearTextZone();
demo.state = DEMO_IDLE;
LCD_UsrLogY("> HID application closed.\n");
demo.select = 0;
break;
default:
break;
}
}
}
break;
case HID_MOUSE_START:
USR_MOUSE_Init();
demo.mouse_state = HID_MOUSE_WAIT;
HID_MOUSE_UpdatePosition(0,0);
break;
default:
break;
}
}
示例6: USR_MOUSE_ProcessData
/**
* @brief USR_MOUSE_ProcessData
* Process Mouse data
* @param data : Mouse data to be displayed
* @retval None
*/
void USR_MOUSE_ProcessData(HID_MOUSE_Data_TypeDef *data)
{
uint8_t idx = 1;
static uint8_t b_state[3] = { 0, 0 , 0};
char temp[20];
if(DEMO_HID_ShowData == 0)
{
if ((data->x != 0) && (data->y != 0))
{
HID_MOUSE_UpdatePosition(data->x , data->y);
}
for ( idx = 0 ; idx < 3 ; idx ++)
{
if(data->button & 1 << idx)
{
if(b_state[idx] == 0)
{
HID_MOUSE_ButtonPressed (idx);
b_state[idx] = 1;
}
}
else
{
if(b_state[idx] == 1)
{
HID_MOUSE_ButtonReleased (idx);
b_state[idx] = 0;
}
}
}
}
else
{
sprintf(temp ,"> %02xh %02xh %02xh %02xh\n" , HID_Machine.buff[0],
HID_Machine.buff[1],
HID_Machine.buff[2],
HID_Machine.buff[3]);
LCD_DbgLog(temp);
}
}
示例7: USR_MOUSE_Init
/**
* @brief Init Mouse window.
* @param None
* @retval None
*/
static void USR_MOUSE_Init(void)
{
LCD_LOG_ClearTextZone();
BSP_LCD_SetTextColor(LCD_COLOR_YELLOW);
BSP_LCD_DisplayStringAtLine(4, (uint8_t *)"USB HID Host Mouse Demo... ");
BSP_LCD_SetTextColor(LCD_LOG_DEFAULT_COLOR);
/* Display Mouse Window */
BSP_LCD_DrawRect(MOUSE_WINDOW_X, MOUSE_WINDOW_Y, MOUSE_WINDOW_WIDTH, MOUSE_WINDOW_HEIGHT);
HID_MOUSE_ButtonReleased(0);
HID_MOUSE_ButtonReleased(1);
HID_MOUSE_ButtonReleased(2);
BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
HID_MOUSE_UpdatePosition(0,0);
}
示例8: USR_MOUSE_ProcessData
/**
* @brief USR_MOUSE_ProcessData
* Process Mouse data
* @param data : Mouse data to be displayed
* @retval None
*/
void USR_MOUSE_ProcessData(HID_MOUSE_Data_TypeDef *data)
{
uint8_t idx = 1;
static uint8_t b_state[3] = { 0, 0 , 0};
data_X = data->x;
data_Y = data->y;
data_Button = data->button;
if ((data->x != 0) && (data->y != 0))
{
HID_MOUSE_UpdatePosition(data->x , data->y);
STM_EVAL_LEDToggle(LED_Blue); // added by "STM32"
}
for ( idx = 0 ; idx < 3 ; idx ++)
{
if(data->button & 1 << idx)
{
if(b_state[idx] == 0)
{
HID_MOUSE_ButtonPressed (idx);
b_state[idx] = 1;
}
}
else
{
if(b_state[idx] == 1)
{
HID_MOUSE_ButtonReleased (idx);
b_state[idx] = 0;
}
}
}
}