mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fix ctrl/meta for macosx shortcuts
This commit is contained in:
parent
991b66b67c
commit
2aaab74b80
@ -2,7 +2,7 @@
|
|||||||
var ns = $.namespace("pskl");
|
var ns = $.namespace("pskl");
|
||||||
|
|
||||||
ns.KeyManager = function () {
|
ns.KeyManager = function () {
|
||||||
$(document.body).keyup($.proxy(this.onKeyUp_, this));
|
$(document.body).keydown($.proxy(this.onKeyUp_, this));
|
||||||
};
|
};
|
||||||
|
|
||||||
// Kind of object that make you want to stop front-end _engineering_:
|
// Kind of object that make you want to stop front-end _engineering_:
|
||||||
@ -29,14 +29,13 @@
|
|||||||
|
|
||||||
|
|
||||||
ns.KeyManager.prototype.onKeyUp_ = function(evt) {
|
ns.KeyManager.prototype.onKeyUp_ = function(evt) {
|
||||||
//var isMac = false;
|
var isMac = false;
|
||||||
//if (navigator.appVersion.indexOf("Mac")!=-1) {
|
if (navigator.appVersion.indexOf("Mac")!=-1) {
|
||||||
// Welcome in mac world where vowels are consons and meta used instead of ctrl:
|
// Welcome in mac world where vowels are consons and meta used instead of ctrl:
|
||||||
// isMac = true;
|
isMac = true;
|
||||||
//}
|
}
|
||||||
|
|
||||||
// (isMac ? evt.metaKey : evt.ctrlKey) {
|
if (isMac ? evt.metaKey : evt.ctrlKey) {
|
||||||
if (evt.ctrlKey) {
|
|
||||||
// Get key pressed:
|
// Get key pressed:
|
||||||
var letter = this.CharCodeToKeyCodeMap[evt.which];
|
var letter = this.CharCodeToKeyCodeMap[evt.which];
|
||||||
if(letter) {
|
if(letter) {
|
||||||
|
Loading…
Reference in New Issue
Block a user