Added String method to Modifiers

This commit is contained in:
2023-06-08 00:08:38 -04:00
parent e114c6d700
commit aa46cada1f
2 changed files with 22 additions and 2 deletions

View File

@@ -67,10 +67,11 @@ func main() {
xevent.KeyPressFun(
func(X *xgbutil.XUtil, e xevent.KeyPressEvent) {
symbol, character := xgbkb.KeycodeToKeysym( e.Detail, e.State)
modifiers := xgbkb.StateToModifiers(e.State)
if unicode.IsPrint(character) {
log.Printf("0x%04X | '%s'\n", symbol, string(character))
log.Printf("0x%04X | '%s' %v\n", symbol, string(character), modifiers)
} else {
log.Printf("0x%04X |\n", symbol)
log.Printf("0x%04X | %v\n", symbol, modifiers)
}
if keybind.KeyMatch(X, "Escape", e.State, e.Detail) {