mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
update code and version
This commit is contained in:
parent
dabec28f14
commit
b618176823
@ -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);
|
||||||
|
10
robotgo.go
10
robotgo.go
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user