bugGNU Octave - Bugs: bug #49397, Spacebar key is not recognize as...

 
 

bug #49397: Spacebar key is not recognize as "space"

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Thu 20 Oct 2016 08:32:36 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Avinoam Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 21 Oct 2016 07:51:14 PM UTC, comment #4: 

Because although I think impact of the code change is small, I'm not 100% certain.  That would require more extensive testing which it can get over time on the development branch.  Also, the severity of the bug isn't large.

Rik <rik5>
Group administrator
Fri 21 Oct 2016 07:46:36 PM UTC, comment #3: 

Thanks @Pantxo & @Rik.

@Rik: Why didn't you push it to the stable branch?

Avinoam Kalma <avinoam>
Group Member
Fri 21 Oct 2016 04:37:08 PM UTC, comment #2: 

Patch works fine.  I pushed it here http://hg.savannah.gnu.org/hgweb/octave/rev/65d84345abfc.  Fixed, closing report.

Rik <rik5>
Group administrator
Thu 20 Oct 2016 10:06:57 PM UTC, comment #1: 

I can confirm this behavior with the "space" key. It looks like Qt::Key_Any has the same value as Qt::Key_Space hence the confusion in the key->string mapper. I attached a simple cset.

Here is also a simplified test script:


keypressfcn = @(h,e) disp (e.Key);
figure ("keypressfcn", keypressfcn);


I change the OS to "any" as it also happens on linux, and the category to "Plotting with OpenGL".

(file #38779)

Pantxo Diribarne <pantxo>
Group Member
Thu 20 Oct 2016 08:32:36 PM UTC, original submission:  

consider the following simple script:


function test_space()
global g;

app = init_app();
g = build_GUI(app);

set(g.fig, 'KeyPressFcn', @on_type);
end

function on_type(~,e)
global g;
disp (e.Key);

switch e.Key
    case {'escape'}
        close(g.fig);
        return;
end
end

function app = init_app()
app = struct();
app.sz = [100 200];
end

function g = build_GUI(app)
sz = app.sz;
g = struct();
g.fig = figure('Name','test spacebar', ...
    'NumberTitle','off', 'Menubar','none', 'Resize','off', ...
    'Position',[200 200 sz(2)*2 sz(1)+40]);
end


If you press any key, Octave will print this key. If you press
escape, Octave will print "escape" and quit this script.

The problem: if you press the spacebar, Octave will print
"any" and not "space" as Matlab does.

Avinoam Kalma <avinoam>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #38779:  space.patch added by pantxo (983B - text/x-diff)
file #38778:  test_space.m added by avinoam (517B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by avinoam (Submitted the item)
  • -email is unavailable- added by avinoam
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-21 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-10-20 pantxo StatusConfirmed Patch Submitted
    2016-10-20 pantxo Attached File- Added space.patch, #38779
        CategoryOctave Function Plotting with OpenGL
        StatusNone Confirmed
        Operating SystemMicrosoft Windows Any
    2016-10-20 avinoam Attached File- Added test_space.m, #38778
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code