[SOLVED ] How I can generate the event MOUSEBUTTONDOWN from an external function ?
I receive the external event from infrared remote and I want to simulate the click on a specific button.
Here the port PA15 is used like IR input, this code has been add in the file stm32746g_discovery.c.
void EXTI15_10_IRQHandler(void)
{
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_15);
if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_15)) return;
BSP_LED_Toggle(LED_GREEN);
.....
[decode IR]
[click button]
}
void BSP_IR_Init()
{
GPIO_InitTypeDef gpio_init_structure;
__HAL_RCC_GPIOA_CLK_ENABLE();
gpio_init_structure.Pin = GPIO_PIN_15;
gpio_init_structure.Mode = GPIO_MODE_IT_FALLING;
gpio_init_structure.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOA, &gpio_init_structure);
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
}
in the file Screen1View.cpp
void Screen1View::setupScreen()
{
#ifdef SIMULATOR
printf("LED on\n");
#else
BSP_LED_Init(LED_GREEN);
BSP_IR_Init();
...........