|
From: | Mark Lawson |
Subject: | Re: [Xbindkeys-devel] Undocumented mouseclick/mousebutton modifiers? |
Date: | Fri, 25 Nov 2016 16:04:40 -0800 |
Sorry, at this point I have no idea why it doesn't work.You can try to either debug or cram a bunch of print statements somewhere in this "case": https://github.com/p-himik/xbindkeys/blob/4aefb3536a 15ff0d6a434987358a94e210c2b4ce /xbindkeys.c#L376 As far as I recall, in Qt framework mouse events have not only "button" field, but also "buttons" that should be used exactly when you try to press multiple buttons. Maybe in the case of XEvent it's something similar.EugeneOn Fri, Nov 25, 2016 at 2:16 PM, Mark Lawson <address@hidden> wrote:;; testUnfortunately, when I have:Hey Eugene,Haha, my bad, yes I see what you meant now :)(xbindkey (list allmods "b:1" "b:8") "test_script")The script does not fire, in any case. Pressing b:1 down, then b:8 does not work, nor does any other combination I could think of. b:1 or b:8 by themselves do not trigger it, either.I did try looking in xev again, and saw this:b:8 pressed down by itself:
ButtonPress event, serial 38, synthetic NO, window 0xc600001,
root 0x29b, subw 0xc600002, time 1759241354, (45,41), root:(530,442),
state 0x0, button 8, same_screen YESb:1 pressed down, and then b:8 pressed down (only showing the ButtonPress event for b:8 being pressed):
ButtonPress event, serial 38, synthetic NO, window 0xc600001,
root 0x29b, subw 0xc600002, time 1759231093, (45,41), root:(530,442),
state 0x100, button 8, same_screen YESI'm not sure if that is a good lead on anything right there though. Since that "state" is represented by m:32768, I would expect it to cover 0x100.Thanks,KevinOn Thu, Nov 24, 2016 at 10:17 PM, Eugene Pakhomov <address@hidden> wrote:I got that the first time. :)What I meant is - what happens when you use '(list allmods "b:1" "b:8")'? Does it trigger "test_script" when you simultaneously press b:1 and b:8?If yes, it's pretty easy to write a function that would create all alternative mappings for a particular button.EugeneOn Fri, Nov 25, 2016 at 1:13 PM, Mark Lawson <address@hidden> wrote:MarkThanks,I hope I explained that correctly -- please let me know if I'm not being clear enough.As for the command -- the following worked in the cases of control, alt, and shift being pressed down, but not with "b:1" pressed down, or "b:3" pressed down:Hi Eugene,Understood.;; test(xbindkey (list allmods "b:8") "test_script")So, to be clear, the above works in all cases other than when "b:1" or "b:3" is pressed down at the time "b:8" is pressed down.On Thu, Nov 24, 2016 at 8:56 PM, Eugene Pakhomov <address@hidden> wrote:Removing xbindkeys-devel, since I think it's not really related to the channel.I don't think you need "+" in that (list...). Can you try without it?EugeneOn Fri, Nov 25, 2016 at 2:54 AM, Mark Lawson <address@hidden> wrote:Forgot to reply all -- my mistake :) Thanks again for the help.On Thu, Nov 24, 2016 at 11:35 AM, Mark Lawson <address@hidden> wrote:;; testI tried to do the following, but had no luck, trying to get "b:8" to trigger the script when "b:3" is pressed down already:However, "allmods" does not seem to be covering the mouseclick modifiers, still. So, if I press down right click, and then press "b:8", the script does not fire.Hi Eugene,Thanks for the quick response! I believe that this has solved half of the problem. Using this fork, and the exact same command structure that you listed, my "b:8" key works just fine with the control, shift, and alt modifiers pressed down now.
(define allmods "m:32768")(xbindkey (list allmods "b:8" + "b:3") "test_script")Here "b:3" is my right click, but I had no luck with this. I couldn't get the script to fire in any situation with this line of configuration.Any thoughts?Thank you,MarkOn Thu, Nov 24, 2016 at 6:59 AM, Eugene Pakhomov <address@hidden> wrote:Hi Mark,Could you please check if this fork works for you? https://github.com/p-himik/xbindkeys I've sent a PR awhile back, but apparently it didn't make it.In your config, you'd need to use "AnyModifier".E.g. I have these lines in my ~/.xbindkeysrc.scm:(define allmods "m:32768")(xbindkey (list allmods "b:9") "xte 'keydown Control_L' 'key Insert' 'key Insert' 'keyup Control_L'")(xbindkey (list allmods "b:8") "echo 'cycle pause' | socat - /tmp/mpvsocket")Regards,EugeneOn Thu, Nov 24, 2016 at 12:10 PM, Mark Lawson <address@hidden> wrote:"xbindkeys -k" does not recognize forward mouse buttons, though I did notice that when I have the left click button pressed, and then press a normal key (like 'r'), this output is generated:It works as expected in most conditions. However, if the left click button is also pressed down, and is still held down when I press the forward button, the script does not fire.My use case is simple: I am binding the forward button of my Logitech G400s mouse to a new action. All that you would expect would be required is right here:Hello everyone,So far, xbindkeys has always met all my needs. However, I believe that the mouseclick modifiers may not be documented, and more importantly, that they are not recognized when used in the xbindkeysrc file.
"my_script args"
b:9
$ xbindkeys -k
"(Scheme function)"
m:0x100 + c:27
rWhereas for a normal 'r' press, it is simply "m:0x0".When the same thing, but with right click pressed down, I get "m:0x400". Left and right both pressed down, predictably, makes "m:0x500".However, I was not able to get any of these modifiers to be respected. First, I tried changing the associated key to "b:9 + b:1", but that would only fire immediately upon b:1 being pressed down; b:9 didnt work at all here.Then, I tried to use "m:0x100 + b:9", however, that did not work either.The only (english) reference I could find online to the most basic "m:0x100" modifier was this:
https://github.com/Zren/WindowsToLinux/blob/master/home/chri s/.xbindkeysrc Which seems to imply that it is the same thing as "b:1". But I would imagine that "b:1" is the button itself, whereas "m:0x100" is the state of the mouse at the time some other button is pressed down.Any suggestions? My ultimate goal is for this forward mouse button to trigger my script regardless of whether or not the left or right click buttons are pressed down at the time I hit the forward button.Thanks for reading!-Mark
[Prev in Thread] | Current Thread | [Next in Thread] |