Skip to content

Commit 19e5617

Browse files
committed
remove KeyTap() legacy key delay default value and Update godoc
1 parent 1993634 commit 19e5617

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

bitmap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ func CopyBitPB(bitmap C.MMBitmapRef) bool {
355355
}
356356

357357
// Deprecated: CopyBitpb copy bitmap to pasteboard, Wno-deprecated
358+
//
359+
// This function will be removed in version v1.0.0
358360
func CopyBitpb(bitmap C.MMBitmapRef) bool {
359361
tt.Drop("CopyBitpb", "CopyBitPB")
360362
return CopyBitPB(bitmap)

robotgo.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ func KeyTap(tapKey string, args ...interface{}) string {
663663
keyT = "null"
664664
keyArr []string
665665
num int
666-
keyDelay = 10
666+
keyDelay int // This is legacy and drop option, use robotgo.KeySleep
667667
)
668668

669669
if _, ok := Special[tapKey]; ok {
@@ -891,7 +891,11 @@ func inputUTF(str string) {
891891

892892
// TypeStr send a string, support UTF-8
893893
//
894-
// robotgo.TypeStr(string: The string to send, float64: microsleep time, x11)
894+
// robotgo.TypeStr(string: The string to send, float64: microsleep time, x11 option)
895+
//
896+
// Examples:
897+
// robotgo.TypeStr("abc@123, hi, こんにちは")
898+
//
895899
func TypeStr(str string, args ...float64) {
896900
var tm, tm1 = 0.0, 7.0
897901

@@ -931,7 +935,8 @@ func TypeStr(str string, args ...float64) {
931935
MilliSleep(KeySleep)
932936
}
933937

934-
// PasteStr paste a string, support UTF-8
938+
// PasteStr paste a string, support UTF-8,
939+
// write the string to clipboard and tap `cmd + v`
935940
func PasteStr(str string) string {
936941
err := clipboard.WriteAll(str)
937942
if err != nil {
@@ -945,8 +950,10 @@ func PasteStr(str string) string {
945950
return KeyTap("v", "control")
946951
}
947952

948-
// Deprecated: TypeString send a string, support unicode
953+
// Deprecated: TypeString send a string, support unicode(no linux support)
949954
// TypeStr(string: The string to send), Wno-deprecated
955+
//
956+
// This function will be removed in version v1.0.0
950957
func TypeString(str string, delay ...int) {
951958
tt.Drop("TypeString", "TypeStr")
952959
var cdelay C.size_t
@@ -967,6 +974,8 @@ func TypeStrDelay(str string, delay int) {
967974
}
968975

969976
// Deprecated: TypeStringDelayed type string delayed, Wno-deprecated
977+
//
978+
// This function will be removed in version v1.0.0
970979
func TypeStringDelayed(str string, delay int) {
971980
tt.Drop("TypeStringDelayed", "TypeStrDelay")
972981
TypeStrDelay(str, delay)
@@ -978,7 +987,8 @@ func SetKeyDelay(delay int) {
978987
}
979988

980989
// Deprecated: SetKeyboardDelay set keyboard delay, Wno-deprecated,
981-
// this function will be removed in version v1.0.0
990+
//
991+
// This function will be removed in version v1.0.0
982992
func SetKeyboardDelay(delay int) {
983993
tt.Drop("SetKeyboardDelay", "SetKeyDelay")
984994
SetKeyDelay(delay)
@@ -1147,6 +1157,8 @@ func GetHandle() int {
11471157
}
11481158

11491159
// Deprecated: GetBHandle get the window handle, Wno-deprecated
1160+
//
1161+
// This function will be removed in version v1.0.0
11501162
func GetBHandle() int {
11511163
tt.Drop("GetBHandle", "GetHandle")
11521164
hwnd := C.bget_handle()

0 commit comments

Comments
 (0)