Problem with the context menu on a Mac laptop

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Problem with the context menu on a Mac laptop

Postby JeffD » Tue Oct 15, 2013 7:49 pm

If I select some text by dragging the mouse cursor over it, it gets highlighted as it should; but if I then bring up the context menu, the highlighting vanishes (not a problem in itself), and it's as if I hadn't selected anything. "Cut" and "Copy" are greyed out in the menu. I think it has something to do with mouse buttons. To drag the cursor and select, I have to press on the mouse pad (like pressing the left button); and to bring up the content menu, I have to hold down the command key and press again. It's normally control + press that brings up such menus, but with RSyntaxEditPanel I have to use command + press.

If I change in mouseReleased in RTextAreaMutableCaretEvent in RTextArea to use MouseEvent.BUTTON1_MASK instead of MouseEvent.BUTTON3_MASK, the menu comes up whenever I do the equivalent of left click, which is what I have to do to move the caret using the mouse. There's probably some way to make the menu come up with control+press, which might work, but I don't know what it is.

Also, if I select some text as above, copy it with command-C (this works), and try to paste it using command-V, I have to do command-V twice to make the pasted text appear. It looks like the first command-V doesn't have to be a command-V; moving the mose cursor and clicking to set its position will also work -- and that will often be what someone does when cutting and pasting.

I don't know how to tell what the version number is, but I downloaded from git today.
JeffD
 
Posts: 3
Joined: Tue Oct 15, 2013 7:15 pm

Re: Problem with the context menu on a Mac laptop

Postby JeffD » Fri Oct 18, 2013 12:45 pm

I have at least partially solved the first problem described above -- the select/cut/paste/context-menu one -- by changing mouseReleased in RTextAreaMutableCaretEvent in RTextArea to do this:

Code: Select all
public void mouseReleased(MouseEvent e) {
        if (// Was: (e.getModifiers()&MouseEvent.BUTTON3_MASK)!=0
            (e.getModifiersEx()&MouseEvent.CTRL_DOWN_MASK)!=0)
                showPopup(e);
}


Now the menu comes up on control-press and it (so far, at least) doesn't interfere with cutting and pasting.
JeffD
 
Posts: 3
Joined: Tue Oct 15, 2013 7:15 pm

Re: Problem with the context menu on a Mac laptop

Postby robert » Fri Oct 18, 2013 12:58 pm

Thanks Jeff! I have a Macbook Pro I can test these issues out on. I'm really keyboard driven so I may not have noticed problems with the context menu.
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm

Re: Problem with the context menu on a Mac laptop

Postby robert » Sat Oct 26, 2013 9:42 pm

The Ctrl vs. Command issue is now fixed. There is still a little wonkiness about the selection disappearing on mouse release when the context menu is displayed, if you did so inside the selection (as opposed to somewhere outside of it). I'm not sure why that is, and I'm investigating it.

As for the second issue, I can't reproduce it. If you select text, and Command+C then Command+V, the selected text will be replaced with a copy of itself (so it appears that there was no change even though there was). If you were referring to something else, could you give more details?
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron