From 25b67bc99ef54aec5c268129d3ac0531392b33ac Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 5 Nov 2024 15:01:53 +0300 Subject: [PATCH] highgui: drop legacy waitkey behavior --- .../introduction/env_reference/env_reference.markdown | 2 -- modules/highgui/src/window.cpp | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/doc/tutorials/introduction/env_reference/env_reference.markdown b/doc/tutorials/introduction/env_reference/env_reference.markdown index afbde7b715..d9145db4d1 100644 --- a/doc/tutorials/introduction/env_reference/env_reference.markdown +++ b/doc/tutorials/introduction/env_reference/env_reference.markdown @@ -119,7 +119,6 @@ Links: ## backends -OPENCV_LEGACY_WAITKEY Some modules have multiple available backends, following variables allow choosing specific backend or changing default priorities in which backends will be probed (e.g. when opening a video file). | name | type | default | description | @@ -327,7 +326,6 @@ Some external dependencies can be detached into a dynamic library, which will be | name | type | default | description | |------|------|---------|-------------| -| OPENCV_LEGACY_WAITKEY | non-null | | switch `waitKey` return result (default behavior: `return code & 0xff` (or -1), legacy behavior: `return code`) | | $XDG_RUNTIME_DIR | | | Wayland backend specific - create shared memory-mapped file for interprocess communication (named `opencv-shared-??????`) | | OPENCV_HIGHGUI_FB_MODE | string | `FB` | Selects output mode for the framebuffer backend (`FB` - regular frambuffer, `EMU` - emulation, perform internal checks but does nothing, `XVFB` - compatible with _xvfb_ virtual frambuffer) | | OPENCV_HIGHGUI_FB_DEVICE | file path | | Path to frambuffer device to use (will be checked first) | diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index b323fbc59b..fb95ca929b 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -646,16 +646,7 @@ int cv::waitKeyEx(int delay) int cv::waitKey(int delay) { CV_TRACE_FUNCTION(); - int code = waitKeyEx(delay); -#ifndef WINRT - static int use_legacy = -1; - if (use_legacy < 0) - { - use_legacy = getenv("OPENCV_LEGACY_WAITKEY") != NULL ? 1 : 0; - } - if (use_legacy > 0) - return code; -#endif + const int code = waitKeyEx(delay); return (code != -1) ? (code & 0xff) : -1; }