本文簡要介紹 python 語言中 matplotlib.backend_bases.KeyEvent
的用法。
-
基礎:
LocationEvent
按鍵事件(按鍵按下、按鍵釋放)。
除了父類
Event
和LocationEvent
定義的屬性之外,KeyEvent 還具有許多特殊屬性。注意
修飾鍵將作為按下鍵的前綴,並按 "ctrl"、"alt"、"super" 的順序排列。此規則的例外情況是按下的鍵本身是修飾鍵,因此 "ctrl+alt" 和 "alt+control" 都可以是有效的鍵值。
例子
def on_key(event): print('you pressed', event.key, event.xdata, event.ydata) cid = fig.canvas.mpl_connect('key_press_event', on_key)
- 屬性:
- key 無或字符串
-
按下的鍵。可能是
None
、單個區分大小寫的 Unicode 字符("g"、"G"、"#" 等)、特殊鍵("control"、"shift"、"f1"、"up" 等.) 或以上的組合(例如,"ctrl+alt+g"、"ctrl+alt+G")。
用法
class matplotlib.backend_bases.KeyEvent(name, canvas, key, x=0, y=0, guiEvent=None)
相關用法
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib MovieWriterRegistry.register用法及代碼示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代碼示例
- Python matplotlib warn_deprecated用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
- Python matplotlib Axes.inset_axes用法及代碼示例
- Python matplotlib delete_parameter用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.backend_bases.KeyEvent。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。