PCBNew Hijacking Keys In Scripting Console

Bug #1379352 reported by Ian Woloschin
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Unassigned

Bug Description

On OS X 10.9.5 using KiCad Rev 5171 with scripting enabled, I cannot type some letters into the scripting console.

For example, I'm trying to import the pcbnew Python module:

Welcome To PyCrust 0.9.8 - KiCAD Python Shell
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
imprt pcbnew
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name 'imprt' is not defined

The 'o' key is being hijacked by PCBNew, and if I click on the canvas without doing anything else, it tries to help me place a module, which makes sense because that what the 'o' hotkey is used for. It seems that the 'o' key is the only one being hijacked at the moment. I suspect it's related specifically to the "Place Module" function because if I try modifying the hotkey to something else (say 'p') then that key no longer works in the scripting console.

My 5 second work around, change the "Place Module" hotkey to CMD+O (which is listed as CTRL+O in the Hotkey Editor...but that might be another bug?).

Tags: python
Revision history for this message
Nick Østergaard (nickoe) wrote :

Also you spelled import wrongly in your prompt example. I am not sure if that is what you are trying to illustrate. I see similar behaivour on linux with 5171, but I am able to make the prompt work by putting the cursor in the end of the latest prompt line with the >>> chars in the beginning. Can you reproduce?

Revision history for this message
Ian Woloschin (iwoloschin) wrote :

Yes, that is correct. If you can't type 'o' you can't spell "import" correctly ;). I just copied the text, as seen in my scripting console, after trying to type the command.

I've upgraded to Rev 5173 this morning, so the nomenclature has changed, but as long as the "Place Footprint" (formally Place Module) is set to a plain alphanumeric character with no modifier keys it is impossible to type that character into the scripting console. I can copy and paste an 'o' into the scripting console, but trying to enter an 'o' via the keyboard does not work.

Also, keep in mind, this key hijacking follows whatever hotkey is used for the 'Place Footprint' action, so if it changes to something other than 'o' that key is then hijacked. Obviously doing something like 'Ctrl+O' is a decent workaround, since that would not generate a regular character for the scripting console anyways.

I cannot type anything into the console unless the cursor is at the >>> prompt, but I believe that is a conscious design decision in PyCrust, so I do not think that is actually a bug. Not being able to type a single alphanumeric character is most definitely a bug, and clearly related to PCBNew's hotkey handling. I am not enough of a C++ programmer to easily figure this out myself, though it's simple enough to apply patches and recompile for a test. I might be able to do some poking this weekend, but again, I'm a hardware guy, so software is not my forte.

tags: added: python
Revision history for this message
jean-pierre charras (jp-charras) wrote :

Can you try the version BZR rev 5243 or more recent, and see if your issue is still here ?

Changed in kicad:
status: New → Incomplete
Revision history for this message
Ian Woloschin (iwoloschin) wrote :

Issue looks to be resolved.

Of note, there's some funkiness going on with window focus between the PyCrust window and PCBNew window, especially when you're typing commands that pop up the autocomplete list, but that's a separate issue.

Changed in kicad:
status: Incomplete → Fix Committed
Revision history for this message
Andy Peters (devel-latke) wrote :

This affects me, and I've been building on OS X 10.10 daily (just did BZR 5469).

Jon Neal (reportingsjr)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.