Announcements

Robots are revolutionizing our lives in many ways. Join our webinar to learn about Infineon’s broad portfolio of robot building blocks.
Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4 Forum Discussions

Sanket24
Level 1
Level 1
10 replies posted 25 sign-ins 5 replies posted

Hello All,

I am Sanket more. Currently i am working on USB-HID TOUCHPAD.

I am using CY8C4246AZI-L445 without gesture.

I want to get single click and double click using touchpad and send all data to usb.

If anyone have positive outcome on this,so then please reply back.

Thanks and regards,

Sanket More  

0 Likes
1 Solution

I use the below codes to achieve the mouse double click.

mouseData[0] = 0x0A;//right click
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}

/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
CyDelay(100);

mouseData[0] = 0x08;//release
/* Wait for ACK before loading data. */
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}
/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
mouseData[0] = 0x0A;//right click
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}

/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
CyDelay(100);

I attached my test project, which the Button 0.6 active, the right click will double click. If you have other custom application, please design the code depending on your requirement.

View solution in original post

0 Likes
5 Replies
LinglingG_46
Moderator
Moderator
Moderator
10 questions asked 5 questions asked 250 sign-ins

I have a test project which can use a button to control the mouse move from right to left.

Please check if you want, if you need to distinguish between  signal click and double click, you can add the logic based on the project.

0 Likes
Sanket24
Level 1
Level 1
10 replies posted 25 sign-ins 5 replies posted

Thanks for support,

But i am trying to take left click and right click using touchpad sense(by single click and double click). here main motive to take sense from touchpad. i already take attempts using button it is working.

i am looking for reply,

 

thanks and regards,

sanket more

0 Likes

I use the below codes to achieve the mouse double click.

mouseData[0] = 0x0A;//right click
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}

/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
CyDelay(100);

mouseData[0] = 0x08;//release
/* Wait for ACK before loading data. */
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}
/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
mouseData[0] = 0x0A;//right click
while (0u == USBFS_GetEPAckState(MOUSE_ENDPOINT))
{
}

/* Load endpoint with data after ACK has been received. */
USBFS_LoadInEP(MOUSE_ENDPOINT, mouseData, MOUSE_DATA_LEN);
CyDelay(100);

I attached my test project, which the Button 0.6 active, the right click will double click. If you have other custom application, please design the code depending on your requirement.

0 Likes
Sanket24
Level 1
Level 1
10 replies posted 25 sign-ins 5 replies posted

Hello Sir,

I understand and implemented it. it is working fine.

but i want to take action from touchpad sense without gesture. All cursor movement on touchpad, single click and right click on button working good.

But i am trying to take single click and double click on touchpad not on button. This is my major task related to touchpads. please any positive comes always welcome.

Thanks and regards,

Sanket More

0 Likes

I think the button and touchpad is similar.

I think we only can help you if you meet some difficulty.

You can tell us what you have try and what difficulty you meet, we can help you.

More about the capsense touchpad, please refer to the below linkers:

1:

https://www.infineon.com/dgdl/Infineon-AN85951_PSoC_4_and_PSoC_6_MCU_CapSense_Design_Guide-Applicati...

2:

https://www.infineon.com/dgdl/Infineon-AN64846_Getting_Started_with_CapSense-ApplicationNotes-v27_00...

 

 

0 Likes
This widget could not be displayed.