I'm trying to build a UI that responds to different keys.
while True:
k = cv2.waitKey(1) # I get the same results using waitKeyEx
if k == -1:
continue
if k == 27 or k == ord('q'): # 27 is the Escape key
cv2.destroyAllWindows()
return
if k == 113:
print('f2 hit')
My problem is, hitting the 'q' button and hitting my 'f2' button both create a k value of 113.
Is there any way to distinguish between these two keys?
Is there an equivalent for the ord('q') call that can be used with f-keys?
Opencv 4.5.3
Windows 10
GUI:
QT: YES (ver 5.12.9)
QT OpenGL support: NO