मैं एक matplotlib है और मैं एक button_press_event
इस तरह बनाया है:matplotlib: आकृति पर शिफ्ट क्लिक कैसे करें?
self.fig.canvas.mpl_connect('button_press_event', self.onClick)
def onClick(self, event)
if event.button == 1:
# draw some artists on left click
elif event.button == 2:
# draw a vertical line on the mouse x location on wheel click
elif event.button == 3:
# clear artists on right click
अब यह इस
elif event.button == 2 or (event.button == 1 and event.key == "shift"):
# draw a vertical line on the mouse x location
# on wheel click or on shift+left click
# (alternative way if there is no wheel for example)
की तरह कुछ करने के लिए पहिया क्लिक हैंडलर संशोधित करने के लिए ऐसा लगता है कि button_press_event
नहीं है संभव है समर्थन कुंजी और key_press_event
माउस बटन क्लिक का समर्थन नहीं करता है, लेकिन मुझे यकीन नहीं है।
क्या कोई तरीका है?
एक अच्छा विचार है और वैकल्पिक हल की तरह लगता है जब तक माउस बटन के साथ संशोधक कुंजियों के लिए एक उचित समर्थन कार्यान्वित किया जाता है। धन्यवाद विक्टर! – NotNone