event.type=NONE if shift is pressed ( for MINUS and SEMI_COLON ) #49314

Closed
opened 2016-09-10 09:14:48 +02:00 by Shams Kitz · 7 comments

System Information

Ubuntu 16.04.1 LTS / Nvidia 210

Blender Version

Broken: 2.78 7e7a9d1
Worked: 2.77

Short description of error

Mappings to certain keys do not work because the event.type is NONE instead of the expected value.

MINUS and SEMI_COLON, namely.

Exact steps for others to reproduce the error

Based on a (as simple as possible) attached .blend file with minimum amount of steps

testkeypressvalue.blend

In the attached blend is a text file with the contents:

import bpy

class TestKeyPressValue(bpy.types.Operator):

    bl_idname = "system.test_keypress_value"
    bl_label = "Test Keypress Value"

    def modal(self, context, event):
        if event.type in {'LEFTMOUSE','RIGHTMOUSE', 'ESC'}:
            return {'CANCELLED'}
        if event.value == 'PRESS':
            print("type:{event.type} shift:{event.shift}".format(event=event))
        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

def register():
    bpy.utils.register_class(TestKeyPressValue)

def unregister():
    bpy.utils.unregister_class(TestKeyPressValue)

Having blender opened from a terminal or with the console open to see printed output, run the script and then with the mouse in the viewport, execute the operator 'Test Keypress Value' from the spacebar menu.

press and observe what the - and ; do with and without the shift key pressed. I am getting NONE for the type of event instead of MINUS or SEMI_COLON, respectively, whenever shift is pressed.

I haven't had time to test this on all possible key combinations but perhaps there are other affected keys as well.

thanks

**System Information** Ubuntu 16.04.1 LTS / Nvidia 210 **Blender Version** Broken: 2.78 7e7a9d1 Worked: 2.77 **Short description of error** Mappings to certain keys do not work because the event.type is NONE instead of the expected value. MINUS and SEMI_COLON, namely. **Exact steps for others to reproduce the error** Based on a (as simple as possible) attached .blend file with minimum amount of steps [testkeypressvalue.blend](https://archive.blender.org/developer/F357001/testkeypressvalue.blend) In the attached blend is a text file with the contents: ``` import bpy class TestKeyPressValue(bpy.types.Operator): bl_idname = "system.test_keypress_value" bl_label = "Test Keypress Value" def modal(self, context, event): if event.type in {'LEFTMOUSE','RIGHTMOUSE', 'ESC'}: return {'CANCELLED'} if event.value == 'PRESS': print("type:{event.type} shift:{event.shift}".format(event=event)) return {'RUNNING_MODAL'} def invoke(self, context, event): context.window_manager.modal_handler_add(self) return {'RUNNING_MODAL'} def register(): bpy.utils.register_class(TestKeyPressValue) def unregister(): bpy.utils.unregister_class(TestKeyPressValue) ``` Having blender opened from a terminal or with the console open to see printed output, run the script and then with the mouse in the viewport, execute the operator 'Test Keypress Value' from the spacebar menu. press and observe what the - and ; do with and without the shift key pressed. I am getting NONE for the type of event instead of MINUS or SEMI_COLON, respectively, whenever shift is pressed. I haven't had time to test this on all possible key combinations but perhaps there are other affected keys as well. thanks
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @bpygrams

Added subscriber: @bpygrams

Added subscriber: @mont29

Added subscriber: @mont29

Yeah… thanks for the investigation, this is due to 16cb939163, will merge with other similar report below, and rework this… thing one more time.

Yeah… thanks for the investigation, this is due to 16cb939163, will merge with other similar report below, and rework this… thing one more time.

Closed as duplicate of #49303

Closed as duplicate of #49303

This issue was referenced by 037df2aaa6

This issue was referenced by 037df2aaa6b36aa4f4e78f3ef978a8196be0057d

Changed status from 'Duplicate' to: 'Resolved'

Changed status from 'Duplicate' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49314
No description provided.