Example #1
0
func xgbUngrab(shortcut string) bool {
	if len(shortcut) < 1 {
		return false
	}

	mod, codes, err := keybind.ParseString(X, shortcut)
	if err != nil {
		fmt.Printf("Parse shortcut '%s' failed: %v\n", shortcut, err)
		return false
	}

	for _, code := range codes {
		keybind.Ungrab(X, X.RootWin(), mod, code)
	}

	return true
}
Example #2
0
func ungrabKey(wid xproto.Window, shortcut string) bool {
	if len(shortcut) < 1 {
		logger.Warning("Ungrab args failed...")
		return false
	}

	shortcut = convertKeysym2Weird(shortcut)
	mod, keys, err := keybind.ParseString(X, shortcut)
	if err != nil {
		logger.Warning("In UngrabKey Parse shortcut failed:", err)
		return false
	}

	for _, k := range keys {
		keybind.Ungrab(X, wid, mod, k)
	}

	return true
}