chore: KeyShortcut toHuman text (#510)

This commit is contained in:
hstyi
2025-04-15 09:19:16 +08:00
committed by GitHub
parent a7d7ffa2cc
commit 8f86057dcc

View File

@@ -1,5 +1,6 @@
package app.termora.keymap package app.termora.keymap
import com.formdev.flatlaf.util.SystemInfo
import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.StringUtils
import java.awt.event.KeyEvent import java.awt.event.KeyEvent
import javax.swing.KeyStroke import javax.swing.KeyStroke
@@ -23,7 +24,14 @@ class KeyShortcut(val keyStroke: KeyStroke) : Shortcut() {
text = text.replace("MINUS", "-") text = text.replace("MINUS", "-")
} }
return text.toCharArray().joinToString(" + ") text = text.toCharArray().joinToString(" + ")
if (SystemInfo.isWindows || SystemInfo.isLinux) {
text = text.replace("", "Shift")
text = text.replace("", "Ctrl")
text = text.replace("", "Alt")
}
return text
} }
} }