update code and version

This commit is contained in:
vcaesar 2018-04-20 23:19:22 +08:00
parent dabec28f14
commit b618176823
2 changed files with 7 additions and 7 deletions

View File

@ -225,8 +225,8 @@ void toggleUnicode(UniChar ch, const bool down)
int min, max, numcodes; int min, max, numcodes;
XDisplayKeycodes(dpy, &min, &max); XDisplayKeycodes(dpy, &min, &max);
KeySym *keysym; KeySym *keysym;
keysym = XGetKeyboardMapping(dpy, min,max-min+1, &numcodes); keysym = XGetKeyboardMapping(dpy, min, max-min+1, &numcodes);
keysym[(max-min-1)*numcodes]=sym; keysym[(max-min-1)*numcodes] = sym;
XChangeKeyboardMapping(dpy, min, numcodes, keysym, (max-min)); XChangeKeyboardMapping(dpy, min, numcodes, keysym, (max-min));
XFree(keysym); XFree(keysym);
XFlush(dpy); XFlush(dpy);

View File

@ -66,7 +66,7 @@ import (
) )
const ( const (
version string = "v0.48.0.549, Ben Nevis!" version string = "v0.48.0.556, Ben Nevis!"
) )
type ( type (
@ -692,7 +692,7 @@ func CharCodeAt(s string, n int) rune {
return 0 return 0
} }
func toUc(text string) []string { func toUC(text string) []string {
var uc []string var uc []string
textQuoted := strconv.QuoteToASCII(text) textQuoted := strconv.QuoteToASCII(text)
@ -706,7 +706,7 @@ func toUc(text string) []string {
return uc return uc
} }
func inputUtf(str string) { func inputUTF(str string) {
cstr := C.CString(str) cstr := C.CString(str)
C.input_utf(cstr) C.input_utf(cstr)
@ -716,9 +716,9 @@ func inputUtf(str string) {
// TypeStr type string, support UTF-8 // TypeStr type string, support UTF-8
func TypeStr(str string) { func TypeStr(str string) {
if runtime.GOOS == "linux" { if runtime.GOOS == "linux" {
strUc := toUc(str) strUc := toUC(str)
for i := 0; i < len(strUc); i++ { for i := 0; i < len(strUc); i++ {
inputUtf(strUc[i]) inputUTF(strUc[i])
MicroSleep(7) MicroSleep(7)
} }
} else { } else {