mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
...
This commit is contained in:
@@ -384,15 +384,15 @@ func (self *KeyEvent) AsCSI() string {
|
|||||||
ans.Grow(32)
|
ans.Grow(32)
|
||||||
ans.WriteString("\033[")
|
ans.WriteString("\033[")
|
||||||
if key != 1 || self.Mods != 0 || shifted_key != 0 || alternate_key != 0 || self.Text != "" {
|
if key != 1 || self.Mods != 0 || shifted_key != 0 || alternate_key != 0 || self.Text != "" {
|
||||||
ans.WriteString(fmt.Sprint(key))
|
fmt.Fprint(&ans, key)
|
||||||
}
|
}
|
||||||
if shifted_key != 0 || alternate_key != 0 {
|
if shifted_key != 0 || alternate_key != 0 {
|
||||||
ans.WriteString(":")
|
ans.WriteString(":")
|
||||||
if shifted_key != 0 {
|
if shifted_key != 0 {
|
||||||
ans.WriteString(fmt.Sprint(shifted_key))
|
fmt.Fprint(&ans, shifted_key)
|
||||||
}
|
}
|
||||||
if alternate_key != 0 {
|
if alternate_key != 0 {
|
||||||
ans.WriteString(fmt.Sprint(":", alternate_key))
|
fmt.Fprint(&ans, ":", alternate_key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
action := 1
|
action := 1
|
||||||
@@ -405,9 +405,9 @@ func (self *KeyEvent) AsCSI() string {
|
|||||||
if self.Mods != 0 || action > 1 || self.Text != "" {
|
if self.Mods != 0 || action > 1 || self.Text != "" {
|
||||||
m := uint(self.Mods)
|
m := uint(self.Mods)
|
||||||
if action > 1 || m != 0 {
|
if action > 1 || m != 0 {
|
||||||
fmt.Fprintf(ans, ";%d", m+1)
|
fmt.Fprintf(&ans, ";%d", m+1)
|
||||||
if action > 1 {
|
if action > 1 {
|
||||||
fmt.Fprintf(ans, ":%d", action)
|
fmt.Fprintf(&ans, ":%d", action)
|
||||||
}
|
}
|
||||||
} else if self.Text != "" {
|
} else if self.Text != "" {
|
||||||
ans.WriteString(";")
|
ans.WriteString(";")
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ func (self *TerminalStateOptions) SetStateEscapeCodes() string {
|
|||||||
sb.WriteString("\033[>u")
|
sb.WriteString("\033[>u")
|
||||||
case NO_KEYBOARD_STATE_CHANGE:
|
case NO_KEYBOARD_STATE_CHANGE:
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(sb, "\033[>%du", self.kitty_keyboard_mode)
|
fmt.Fprintf(&sb, "\033[>%du", self.kitty_keyboard_mode)
|
||||||
}
|
}
|
||||||
if self.mouse_tracking != NO_MOUSE_TRACKING {
|
if self.mouse_tracking != NO_MOUSE_TRACKING {
|
||||||
sb.WriteString(MOUSE_SGR_PIXEL_MODE.EscapeCodeToSet())
|
sb.WriteString(MOUSE_SGR_PIXEL_MODE.EscapeCodeToSet())
|
||||||
|
|||||||
Reference in New Issue
Block a user