Skip to content

Commit

Permalink
Merge pull request #149 from octalmage/typeSlowly
Browse files Browse the repository at this point in the history
Added typeStringDelayed.
  • Loading branch information
octalmage committed Dec 29, 2015
2 parents 2ad647b + 45afde6 commit ef2bdfc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/robotjs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,20 @@ NAN_METHOD(typeString)
info.GetReturnValue().Set(Nan::New(1));
}

NAN_METHOD(typeStringDelayed)
{
char *str;
Nan::Utf8String string(info[0]);

str = *string;

size_t cpm = info[1]->Int32Value();

typeStringDelayed(str, cpm);

info.GetReturnValue().Set(Nan::New(1));
}

NAN_METHOD(setKeyboardDelay)
{
if (info.Length() != 1)
Expand Down Expand Up @@ -666,6 +680,9 @@ NAN_MODULE_INIT(InitAll)
Nan::Set(target, Nan::New("typeString").ToLocalChecked(),
Nan::GetFunction(Nan::New<FunctionTemplate>(typeString)).ToLocalChecked());

Nan::Set(target, Nan::New("typeStringDelayed").ToLocalChecked(),
Nan::GetFunction(Nan::New<FunctionTemplate>(typeStringDelayed)).ToLocalChecked());

Nan::Set(target, Nan::New("setKeyboardDelay").ToLocalChecked(),
Nan::GetFunction(Nan::New<FunctionTemplate>(setKeyboardDelay)).ToLocalChecked());

Expand Down

0 comments on commit ef2bdfc

Please sign in to comment.