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

wxGUI: remove unnecessary key press event handlers #2528

Merged

Conversation

tmszi
Copy link
Member

@tmszi tmszi commented Aug 19, 2022

Describe the bug
With pressing any key is printed error message.

To Reproduce
Steps to reproduce the behavior:

  1. Launch Win GRASS GIS wxGUI (single or multi window mode)
  2. Click on the main toolbar panel widget to get a focus
  3. Press any key e.g. Shift
  4. See error

Single window mode error:

Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
8.3\gui\wxpython\lmgr\frame.py", line 2243, in OnKeyDown

if event.CtrlDown():
AttributeError
:
'KeyEvent' object has no attribute 'CtrlDown'

Multi window mode error:

Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS
8.3\gui\wxpython\main_window\frame.py", line 2284, in
OnKeyDown

if event.CtrlDown():
AttributeError
:
'KeyEvent' object has no attribute 'CtrlDown'

Expected behavior
With pressing any key should not be printed any error message.

System description:

  • Operating System: MS Windows
  • GRASS GIS version: all

Additional context
Keyboard shortcut for add raster map is Ctrl + Shift +R and for vector map is Ctrl + Shift + V defined here:

<wxgui-item name="AddRaster">
<label>Add raster</label>
<handler>OnAddRaster</handler>
<description>Add raster map layer to current display</description>
<shortcut>Ctrl+Shift+R</shortcut>
</wxgui-item>
<wxgui-item name="AddVector">
<label>Add vector</label>
<handler>OnAddVector</handler>
<description>Add vector map layer to current display</description>
<shortcut>Ctrl+Shift+V</shortcut>
</wxgui-item>

@tmszi tmszi added bug Something isn't working backport_needed windows Microsoft Windows specific GUI wxGUI related labels Aug 19, 2022
@tmszi tmszi added this to the 8.2.1 milestone Aug 19, 2022
gui/wxpython/main_window/frame.py Outdated Show resolved Hide resolved
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tmszi tmszi merged commit 5ea69d7 into OSGeo:main Aug 23, 2022
tmszi added a commit to tmszi/grass that referenced this pull request Aug 23, 2022
tmszi added a commit to tmszi/grass that referenced this pull request Aug 23, 2022
tmszi added a commit to tmszi/grass that referenced this pull request Aug 23, 2022
@tmszi tmszi deleted the wxgui-remove-unnecessary-key-press-evt-handlers branch August 23, 2022 18:44
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI wxGUI related windows Microsoft Windows specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants