Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

keypress events cause unavoidable beep sound with wxagg #19658

Open
Labels
GUI: wxkeepItems to be ignored by the “Stale” Github Action
@briantoby

Description

@briantoby

Bug report

Bug summary

Pressing a key in a MPL plot causes a beep. This is not a serious problem, but is annoying.

Code for reproduction

use the code herehttps://matplotlib.org/stable/gallery/event_handling/keypress_demo.html, but add

importmatplotlibmatplotlib.use('wxAgg')

Actual outcome

Every time a key is pressed, I hear a bell sound (a beep).

Expected outcome

I should be able to eliminate this using this in the callback:

defon_press(event):event.guiEvent.Skip(False)    ...

The reason for this is in this callback handler inbackend_wx.py

def_onKeyDown(self,event):"""Capture key press."""key=self._get_key(event)FigureCanvasBase.key_press_event(self,key,guiEvent=event)ifself:event.Skip()

Since the method ends withevent.Skip() (same asevent.Skip(True)) the call toevent.guiEvent.Skip(False) is ignored.
If this is rewritten as:

def_onKeyDown(self,event):"""Capture key press."""ifself:event.Skip()key=self._get_key(event)FigureCanvasBase.key_press_event(self,key,guiEvent=event)

Then existing code will function as before, but there is the option to suppress the beep. One could argue that.Skip(False) should be the default, but that would be a change in how MPL functions.

Matplotlib version

  • Operating system: MacOS 10.15.7
  • Matplotlib version: 3.3.2
  • Matplotlib backend: MacOSX
  • Python version: 3.9.1
  • Jupyter version: N/A
  • Other libraries: wxpython 4.1.1

default conda channels except wxpython from pypi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: wxkeepItems to be ignored by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp