konachan700 / Q11K_Driver

Huion Q11K Driver
GNU General Public License v3.0
13 stars 6 forks source link

Map MiddleClick and Rigtclick to Stilus. #1

Open mifth opened 6 years ago

mifth commented 6 years ago

Hi.

Is it possible to set MiddleClick ans RightClick buttons instead of Ctrl+8 and Ctrl+9? I guess these lines: https://github.com/konachan700/Q11K_Driver/blob/39c6c48ddd060ac51b190be197af36209fbf14b7/q11k_device.c#L266-L267

I tried to replace them with: input_report_key(idev, BTN_MIDDLE, 1); input_report_key(idev, BTN_RIGHT, 1);

But nothing worked. I'm not a programmer. ((

konachan700 commented 6 years ago

Replace q11k_device.c to https://pastebin.com/UJyGe1Rd , make & make install, and replug device. I don't test it =)

mifth commented 6 years ago

Thank you a lot! I'll try tomorrow at monday.

mifth commented 6 years ago

Hi, I tested it. The rightclick and MiddleClick do not work. ((

I checked other examples of wacom drivers https://github.com/UDOOboard/Kernel_Unico/blob/master/drivers/hid/hid-wacom.c#L256 https://github.com/UDOOboard/Kernel_Unico/blob/master/drivers/hid/hid-wacom.c#L264

Maybe we need to put some data in the method?

mifth commented 6 years ago

Or possibly we need to add another tool? BTN_TOOL_MOUSE So that it worked correctly.

konachan700 commented 6 years ago

No. Pen buttons working only when pressure == 0 (pen up). If pressure > 0, report has not contain a buttons code. In windows pen's buttons work incorrect too. It hardware bug.

mifth commented 6 years ago

So, there is no way to make the buttons work? ((

mifth commented 6 years ago

In wacom driver they use BTN_TOOL_MOUSE https://github.com/UDOOboard/Kernel_Unico/blob/master/drivers/hid/hid-wacom.c#L217

konachan700 commented 6 years ago

Buttons work only when pressure == 0 and data[4] == 0xC0 ("a pen upped"). Buttons codes (0xC2, 0xC4) will be replaced "a pen in use" code, data[4] == 0xC1. It is a hardware bug. I not used this buttons on wacom, and i knew about this bug when buy a tablet =)

mifth commented 6 years ago

Thank you for your answers. Unfortunately, I cannot make the buttons work on linux. ((( I have to install windows now. ((((((((((

Thank you a lot!

konachan700 commented 6 years ago

Windows has this bug too. =)

mifth commented 6 years ago

I have windows 7 emulation. Q11k works ok with rightclick and middleclick.

konachan700 commented 6 years ago

Pen's buttons worked in Windows if pen pressed? Really? In my tablet pen's buttons work only if pen not pressed...

mifth commented 6 years ago

Yep. RightClick and Middleclick pen buttons work like in wacom at WindowsOS. Yes, the buttons work without pressure. I just move stilus and press Rightclick. Here is my test: https://youtu.be/uhpfYBpYwuk

1) I pressed RightClick at desktop and new menu appears 2) I Pressed RightClick and holded it and moved the cursor. And the viewport is rotated with the RightClick.

Unfortunately, this does not work with your driver. (((

konachan700 commented 6 years ago

I modify code, middle\right buttons worked in pen not pressed. Please test it.

mifth commented 6 years ago

Sure! =) OK, I updated the code, compiled it and rebooted. Still the buttons do not work. Here is my log if it helps you.

Xorg.0.zip

konachan700 commented 6 years ago

May be disconnect a wacom? In log i see a problem in wacom driver. Please, disconnect wacom, reboot and try again.

mifth commented 6 years ago

OK, I disconnected the wacom and rebooted. Still no luck. (( Here is my new log. Xorg.0.zip