-
Notifications
You must be signed in to change notification settings - Fork 337
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
Different behaviour for Cmd+C, Cmd+v, etc on Mac #7
base: master
Are you sure you want to change the base?
Conversation
+1 |
Now I'm confused. The isMac and ev.metaKey check is there to check for a mac's equivalent of Alt (which is Option, I think?). Why would that if statement affect the Command key? This change would also stop a whole range of key combinations from working. Could either of you show me the raw event output for |
The check for Cmd in mac is Here is Cmd-C: jQuery.Event {originalEvent: KeyboardEvent, type: "keydown", isDefaultPrevented: function, timeStamp: 1391791240401, jQuery182012300834944471717: true…}
altKey: false
attrChange: undefined
attrName: undefined
bubbles: true
cancelable: true
char: undefined
charCode: 0
ctrlKey: false
currentTarget: Window
data: null
delegateTarget: Window
eventPhase: 3
handleObj: Object
isDefaultPrevented: function returnFalse() { // 3279
jQuery182012300834944471717: true
key: undefined
keyCode: 67
metaKey: true
originalEvent: KeyboardEvent
relatedNode: undefined
relatedTarget: undefined
shiftKey: false
srcElement: textarea.ace_text-input
target: textarea.ace_text-input
timeStamp: 1391791240401
type: "keydown"
view: Window
which: 67 Here is Opt-C: jQuery.Event {originalEvent: KeyboardEvent, type: "keydown", isDefaultPrevented: function, timeStamp: 1391791248160, jQuery182012300834944471717: true…}
altKey: true
attrChange: undefined
attrName: undefined
bubbles: true
cancelable: true
char: undefined
charCode: 0
ctrlKey: false
currentTarget: Window
data: null
delegateTarget: Window
eventPhase: 3
handleObj: Object
isDefaultPrevented: function returnFalse() { // 3279
jQuery182012300834944471717: true
key: undefined
keyCode: 229
metaKey: false
originalEvent: KeyboardEvent
relatedNode: undefined
relatedTarget: undefined
shiftKey: false
srcElement: textarea.ace_text-input
target: textarea.ace_text-input
timeStamp: 1391791248160
type: "keydown"
view: Window
which: 229 Here is Ctrl-C: jQuery.Event {originalEvent: KeyboardEvent, type: "keydown", isDefaultPrevented: function, timeStamp: 1391791364750, jQuery182012300834944471717: true…}
altKey: false
attrChange: undefined
attrName: undefined
bubbles: true
cancelable: true
char: undefined
charCode: 0
ctrlKey: true
currentTarget: Window
data: null
delegateTarget: Window
eventPhase: 3
handleObj: Object
isDefaultPrevented: function returnFalse() { // 3279
jQuery182012300834944471717: true
key: undefined
keyCode: 67
metaKey: false
originalEvent: KeyboardEvent
relatedNode: undefined
relatedTarget: undefined
shiftKey: false
srcElement: textarea.ace_text-input
target: textarea.ace_text-input
timeStamp: 1391791364750
type: "keydown"
view: Window
which: 67 |
Ah, okay. So command is considered meta (seriously unfamiliar with mac keyboards). Gotcha. Yeah, I'll add a better check that won't disrupt any other key combinations either. Thanks for checking. |
Yeah, the mode key event attributes in mac are very non-intuitive. |
@petethepig thanks for your patch, works great. |
@chjj would be nice to have this or something to its effect |
See also PR #37. I'm not a Mac user, but assuming that Option+key on Mac should work like Alt+key on other systems, I think that one is preferable - this one appears to disable all Alt shortcuts on Macs. |
I tried to support Cmd-C, Cmd-V on Mac using hidden textarea. |
It allows you to copy/paste any text from/into the terminal.
I suggest it, since this is the default behaviour in Terminal.app on Mac.