debugging issue concerning setCursorVisible()

Home Forum Development Engine Development Discussion debugging issue concerning setCursorVisible()

This topic contains 21 replies, has 7 voices, and was last updated by  Johan Maasing 2 years, 3 months ago.

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #16473

    teique
    7p
    Participant

    Hi!

    When the application stops because of exception, I get into debug mode, but I loose control of the mouse cursor in the system…
    I have no idea how to setCursorVisible(true) just before the IDE go to debug mode.
    I am on linux but on windows I had a similar problem.
    This problem is so that I have to go to text console and kill the java running inside the IDE, in other words I cant debug… :(.

    Any tips on this?

    PS.: I am using jME3_08-18-2010.zip, I put on eclipse cuz the autocompletion broke on NetBeans :(, the debug issue above happened on NetBeans also (even with old sdk lib).

    thx on any tip!

    #112265

    Momoko_Fan
    577p
    Keymaster

    On windows you can just alt-tab into the netbeans debugger and you should get your cursor back. I've been debugging jME3 millions of times and it worked fine for me.
    I think on Linux and Mac things are quite different, since you don't get the cursor back. Maybe normen might have some insight on this.

    #112266

    kirdel
    0p
    Member

    On mac command tab works as well.

    #112267

    teique
    7p
    Participant

    yup thats it..
    on linux, I dont get the cursor back!!!

    on windows I get the cursor back, but its movement is limited to the window size, so if I created a 320×200 window on a 1024×768 desktop (it needs to be small window), I am messed :(, cant even reach the stop button xD

    I think, on linux, may have a way to disable mouse and re-enable it with some command, but havent tried/researched yet…

    anyone else on linux having mouse lock problems? (ubuntu 10.04)

    #112268

    Momoko_Fan
    577p
    Keymaster

    Yeah, Linux is a bit problematic with the cursor handling. In windows the cursor is locked initially to the "former" display window but you can unlock it by alt-tabbing around. You'll get used to it eventually.

    #112269

    MistaHamsta
    0p
    Member

    Momoko_Fan said:

    On windows you can just alt-tab into the netbeans debugger and you should get your cursor back. I've been debugging jME3 millions of times and it worked fine for me.
    I think on Linux and Mac things are quite different, since you don't get the cursor back. Maybe normen might have some insight on this.

    That reflection has a little bug. I think you need to fix it.

    #112270

    MistaHamsta
    0p
    Member

    MistaHamsta said:

    Momoko_Fan said:

    On windows you can just alt-tab into the netbeans debugger and you should get your cursor back. I've been debugging jME3 millions of times and it worked fine for me.
    I think on Linux and Mac things are quite different, since you don't get the cursor back. Maybe normen might have some insight on this.

    I did alt tab on windows xp and it worked but i'm still having issues

    #112271
    +1

    teique
    7p
    Participant

    I found a weird workaround to be able to get mouse back while debugging jme3 on eclipse on ubuntu:
    Menu: window -> show view -> expressions
    add this expression: mouseInput.setCursorVisible(true)
    at any point the application breaks, when the expression be evaluated, the mouse is released!!!!!!!

    YEY !!! back to business!! :D

    PS.: that var mouseInput may not be visible, if so try to create a public static pointing to it.

    EDIT: this works MUCH better:
    org.lwjgl.input.Mouse.setGrabbed(false)

    #112272

    Johan Maasing
    266p
    Participant

    @teique said:
    I found a weird workaround to be able to get mouse back while debugging jme3 on eclipse on ubuntu:
    Menu: window -> show view -> expressions
    add this expression: mouseInput.setCursorVisible(true)
    at any point the application breaks, when the expression be evaluated, the mouse is released!!!!!!!

    YEY !!! back to business!! :D

    PS.: that var mouseInput may not be visible, if so try to create a public static pointing to it.

    EDIT: this works MUCH better:
    org.lwjgl.input.Mouse.setGrabbed(false)

    You are a life saver, this is an old topic but still relevant. It would be nice to make a plug-in for this but before I wade into the netbeans documentation, anyone know if it is even possible to find an event or trigger for when the debugger hits a breakpoint?

    #112273

    kardinal
    4p
    Participant

    @jmaasing said:
    It would be nice to make a plug-in for this but before I wade into the netbeans documentation, anyone know if it is even possible to find an event or trigger for when the debugger hits a breakpoint?

    Or simply to fix the issue on linux based systems, because there are people around who dont use netbeans.

    #112274

    teique
    7p
    Participant

    @kardinal said:
    Or simply to fix the issue on linux based systems, because there are people around who dont use netbeans.

    I would like to suggest another trick,
    you can use xdotool to detect the active window,
    so, when the application stops it will (probably) set the IDE (eclipse or netbeans) to be the active window, when this is detected, you will run a command to make lwjgl ungrab the mouse (as I understand this is a global system behavior and not application specific, someone could confirm this?) so you can create a simple jar and execute it to ungrab the mouse.

    so, this could be a workaround not related to an specific IDE or even other applications (like a frozen Wine application for ex.),

    btw, if someone create such a script (I suggest bash) it would be cool to share it here :)

    #112275
    +1

    kardinal
    4p
    Participant
    #112276

    Momoko_Fan
    577p
    Keymaster

    This issue is impossible for us to fix since once debug mode is entered, jME3 has no control over what’s going on. You will need to find a fix in your OS instead.

    #112277

    Johan Maasing
    266p
    Participant

    Well, jMonkey Engine has no control but the jMonkey SDK sure has, not a complete fix but I’d settle for the SDK emitting the beanshell-expression that you now have to type by hand in “Expressions” window.

    I couldn’t get the ‘ctrl + alt + numpad /’ – XF86_Ungrab sent on the OS-level, seems to have been considered a security flaw and have been removed or disabled in many distros.

    #112278

    Momoko_Fan
    577p
    Keymaster

    Well then that’s something you’re gonna have to ask @Normen for ..

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.