From a9e66ffa4eb61a4728d536d20f916a5a02ab5626 Mon Sep 17 00:00:00 2001 From: Xiao-Yong Date: Tue, 13 Nov 2018 22:57:56 -0600 Subject: devdraw: make ctrl generate 1-click while mouse down (#119) This makes 2-1 chords possible with touchpad on a mac laptop. --- src/cmd/devdraw/cocoa-screen.m | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cmd/devdraw/cocoa-screen.m') diff --git a/src/cmd/devdraw/cocoa-screen.m b/src/cmd/devdraw/cocoa-screen.m index e7296e44..16053eaa 100644 --- a/src/cmd/devdraw/cocoa-screen.m +++ b/src/cmd/devdraw/cocoa-screen.m @@ -927,6 +927,8 @@ getkeyboard(NSEvent *e) case NSFlagsChanged: if(in.mbuttons || in.kbuttons){ in.kbuttons = 0; + if(m & NSControlKeyMask) + in.kbuttons |= 1; if(m & NSAlternateKeyMask) in.kbuttons |= 2; if(m & NSCommandKeyMask) -- cgit v1.2.3 From 7d43dde539378fb5730df6ce961f7916f495746e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 15 Nov 2018 20:28:56 -0500 Subject: devdraw: add Cursor2 support on macOS 10.14 Mojave This replaces the pixel-art scaling algorithm used for upscaling before. The results were not crisp enough to serve as everyday cursors. --- src/cmd/devdraw/cocoa-screen.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cmd/devdraw/cocoa-screen.m') diff --git a/src/cmd/devdraw/cocoa-screen.m b/src/cmd/devdraw/cocoa-screen.m index 16053eaa..c2489a6c 100644 --- a/src/cmd/devdraw/cocoa-screen.m +++ b/src/cmd/devdraw/cocoa-screen.m @@ -1410,8 +1410,10 @@ kicklabel0(char *label) { } void -setcursor(Cursor *c) +setcursor(Cursor *c, Cursor2 *c2) { + USED(c2); + /* * No cursor change unless in main thread. */ @@ -1658,3 +1660,9 @@ setprocname(const char *s) if(err != noErr) fprint(2, "Call to set process name failed\n"); } + +void +resizewindow(Rectangle r) +{ + USED(r); +} -- cgit v1.2.3