Browse Source

v1.1.3: meta key support (mac)

CrazyDoctor 2 months ago
parent
commit
5dc0409069
2 changed files with 5 additions and 5 deletions
  1. 1 1
      package.json
  2. 4 4
      static/page/class/script.js

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 	"name": "doczilla_js_docs",
-	"version": "1.1.2",
+	"version": "1.1.3",
 	"dependencies": {
 		"@types/sqlite3": "^3.1.11",
 		"@types/ws": "^8.5.10",

+ 4 - 4
static/page/class/script.js

@@ -1208,18 +1208,18 @@ window_.on(DOM.Events.Load, (e) => {
 window_.on(DOM.Events.KeyDown, (e) => {
 	if(Class.isPackage)
 		return;
-	if(window.page && e.key === DOM.Keys.Control)
+	if(window.page && (e.ctrlKey || e.metaKey))
 		window.page.codeMirrorEditorElement.addClass(ClassPage.StyleClasses.CtrlPressed);
-	if(window.page && e.key === DOM.Keys.Shift)
+	if(window.page && e.shiftKey)
 		window.page.codeMirrorEditorElement.addClass(ClassPage.StyleClasses.ShiftPressed);
 });
 
 window_.on(DOM.Events.KeyUp, (e) => {
 	if(Class.isPackage)
 		return;
-	if(window.page && e.key === DOM.Keys.Control)
+	if(window.page && (e.ctrlKey || e.metaKey))
 		window.page.codeMirrorEditorElement.removeClass(ClassPage.StyleClasses.CtrlPressed);
-	if(window.page && e.key === DOM.Keys.Shift)
+	if(window.page && e.shiftKey)
 		window.page.codeMirrorEditorElement.removeClass(ClassPage.StyleClasses.ShiftPressed);
 });