Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support waitKeyEx #1184

Open
Thanzex opened this issue Jul 4, 2024 · 3 comments
Open

Support waitKeyEx #1184

Thanzex opened this issue Jul 4, 2024 · 3 comments

Comments

@Thanzex
Copy link

Thanzex commented Jul 4, 2024

Description

This library supports waitKey, but not waitKeyEx or pollKey for that matter.

pollKey is already a fairly big omission, but missing waitKeyEx is a breaking functionality.

Right now waitKey only returns alphanumeric characters + symbols, but no special characters.

This is a problem since directional keys, F-keys, CTRL, SHIFT or ALT or their combination are not supported and either don't show up or report as 0.

waitKeyEx returns the full key code, allowing the whole keyboard to be used.

Steps to Reproduce

package main

import (
	"fmt"

	"gocv.io/x/gocv"
)

func main() {
	window := gocv.NewWindow("Test")
	defer window.Close()

	for {

		/*
		* Do something
		 */

		switch k := window.WaitKey(64); k {
		case 'q':
			return
		default:
			fmt.Println("\nPressed ", k)
		}

	}
}

Your Environment

  • Operating System and version: Windows 11
  • OpenCV version used: 4.10.0
  • How did you install OpenCV? Build in the package directory
  • GoCV version used: 0.37.0
  • Go version: go1.22.4 windows/amd64
@deadprogram
Copy link
Member

Yes, please!

@diegohce
Copy link
Collaborator

Hi all!
Just sent a pull request for adding waitKeyEx.

cheers!

@deadprogram
Copy link
Member

Merged. Tagged to close this on next release. Thanks @diegohce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants