Skip to content

Commit 45afde6

Browse files
committed
Added typeStringDelayed.
1 parent 2ad647b commit 45afde6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/robotjs.cc

+17
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,20 @@ NAN_METHOD(typeString)
573573
info.GetReturnValue().Set(Nan::New(1));
574574
}
575575

576+
NAN_METHOD(typeStringDelayed)
577+
{
578+
char *str;
579+
Nan::Utf8String string(info[0]);
580+
581+
str = *string;
582+
583+
size_t cpm = info[1]->Int32Value();
584+
585+
typeStringDelayed(str, cpm);
586+
587+
info.GetReturnValue().Set(Nan::New(1));
588+
}
589+
576590
NAN_METHOD(setKeyboardDelay)
577591
{
578592
if (info.Length() != 1)
@@ -666,6 +680,9 @@ NAN_MODULE_INIT(InitAll)
666680
Nan::Set(target, Nan::New("typeString").ToLocalChecked(),
667681
Nan::GetFunction(Nan::New<FunctionTemplate>(typeString)).ToLocalChecked());
668682

683+
Nan::Set(target, Nan::New("typeStringDelayed").ToLocalChecked(),
684+
Nan::GetFunction(Nan::New<FunctionTemplate>(typeStringDelayed)).ToLocalChecked());
685+
669686
Nan::Set(target, Nan::New("setKeyboardDelay").ToLocalChecked(),
670687
Nan::GetFunction(Nan::New<FunctionTemplate>(setKeyboardDelay)).ToLocalChecked());
671688

0 commit comments

Comments
 (0)