@@ -16,6 +16,9 @@ NAN_MODULE_INIT(Io::Init) {
1616 Nan::SetMethod (target, " imshowWait" , ImshowWait);
1717 Nan::SetMethod (target, " imwrite" , Imwrite);
1818 Nan::SetMethod (target, " waitKey" , WaitKey);
19+ #if CV_VERSION_GREATER_EQUAL(3, 2, 0)
20+ Nan::SetMethod (target, " waitKeyEx" , WaitKeyEx);
21+ #endif
1922 Nan::SetMethod (target, " imencode" , Imencode);
2023 Nan::SetMethod (target, " imdecode" , Imdecode);
2124 Nan::SetMethod (target, " moveWindow" , MoveWindow);
@@ -105,6 +108,18 @@ NAN_METHOD(Io::WaitKey) {
105108 info.GetReturnValue ().Set (Nan::New (key));
106109}
107110
111+ #if CV_VERSION_GREATER_EQUAL(3, 2, 0)
112+ NAN_METHOD (Io::WaitKeyEx) {
113+ int key;
114+ if (info[0 ]->IsNumber ()) {
115+ key = cv::waitKeyEx (info[0 ]->ToNumber (Nan::GetCurrentContext ()).ToLocalChecked ()->Value ());
116+ } else {
117+ key = cv::waitKeyEx ();
118+ }
119+ info.GetReturnValue ().Set (Nan::New (key));
120+ }
121+ #endif
122+
108123NAN_METHOD (Io::MoveWindow) {
109124 FF::TryCatch tryCatch (" Io::MoveWindow" );
110125 std::string winName;
0 commit comments