-
-
Notifications
You must be signed in to change notification settings - Fork 61
cmd L support for OSX and text selection for (ctrl | cmd) L #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The combo box expands as soon as it gets the focus, this temporarily selects the text and then opens the popup! |
|
Wow, that was fast! I see that you are addressing OSX as well, and that is welcome. But can you try to push the OSX detection to a global level? You can do the detection in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can factor out the common code like this:
KeyStroke keystroke =
isOsX
? KeyStroke.getKeyStroke(KeyEvent.VK_L, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())
: KeyStroke.getKeyStroke("ctrl L");
getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keystroke, "edit URL");|
@hrj Thanks a lot for the suggestions! I was wondering where exactly I should put the enum. BTW there's an issue, can you suggest what can be done about it? #161 (comment) |
|
@hrj I kind of screwed up, forgot I was in master branch all this while. So the latest commit has :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this mask is used in multiple places, you could define it in PlatformInit and call it CMD_CTRL_KS_MASK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I felt that it belongs to UX and PlatformInit might not be right place to have it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good thought. Can you use ComponentSource to host the field then? That seems good enough for current set of changes.
If the mask gets used more widely, we can hoist it up to a larger class like PlatformInit later.
|
This is looking great, except for the hack for #157. Let's keep that separate. About the branch, don't worry. We will use this PR for review and at the end of it, you can create a fresh branch, which is squashed and rebased on master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this to CMD_CTRL_KEY_MASK and update the comment to say "mask for keystroke"?
|
There is only one minor comment left to address. Rest all looks good. When you are done, I can help you with rebasing and squashing the commits. Hit me up on Gitter or IRC. |
|
Superseded by #163 |
Fix for #159