BurntSushi / xgbutil

A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)
Do What The F*ck You Want To Public License
194 stars 46 forks source link

[question] mousebind -- button chords #49

Open dnlo opened 4 years ago

dnlo commented 4 years ago

Thank you for this library, it's real nice, made things so much easier

Mousebind docs say mouse buttons can be modifiers, so mouse chords should work.

But running this code:

package main

import (
    "log"

    "github.com/BurntSushi/xgbutil"
    "github.com/BurntSushi/xgbutil/mousebind"
    "github.com/BurntSushi/xgbutil/xevent"
)

func main() {
    X, err := xgbutil.NewConn()
    if err != nil {
        log.Fatal(err)
    }
    mousebind.Initialize(X)

    cb1 := mousebind.ButtonPressFun(
        func(X *xgbutil.XUtil, e xevent.ButtonPressEvent) {
            log.Println("Button press!")
        })

    err = cb1.Connect(X, X.RootWin(), "button3-1", false, true)
    if err != nil {
        log.Println(err)
    }

    xevent.Main(X)
}

Produces this error:

Could not bind 'button3-1' because: 
BadValue {NiceName: Value, Sequence: 5, BadValue: 1024, MinorOpcode: 0, MajorOpcode: 28}

Any kind of help for solving this would be much appreciated. Thank you again for all your great work