Get cursor position setting working with cocoa

This commit is contained in:
UnknownShadow200 2019-09-22 18:55:03 +10:00
parent cde36cc0f2
commit a637aa517d

View File

@ -1745,6 +1745,13 @@ void Clipboard_SetText(const String* value) {
PasteboardPutItemFlavor(pbRef, 1, FMT_UTF8, cfData, 0); PasteboardPutItemFlavor(pbRef, 1, FMT_UTF8, cfData, 0);
} }
void Cursor_SetPosition(int x, int y) {
CGPoint point;
point.x = x + windowX;
point.y = y + windowY;
CGDisplayMoveCursorToPoint(CGMainDisplayID(), point);
}
void Window_OpenKeyboard(void) { } void Window_OpenKeyboard(void) { }
void Window_CloseKeyboard(void) { } void Window_CloseKeyboard(void) { }
@ -2150,13 +2157,6 @@ static void Cursor_GetRawPos(int* x, int* y) {
*x = (int)point.h; *y = (int)point.v; *x = (int)point.h; *y = (int)point.v;
} }
void Cursor_SetPosition(int x, int y) {
CGPoint point;
point.x = x + windowX;
point.y = y + windowY;
CGDisplayMoveCursorToPoint(CGMainDisplayID(), point);
}
static bool cursorVisible = true; static bool cursorVisible = true;
void Cursor_SetVisible(bool visible) { void Cursor_SetVisible(bool visible) {
if (visible) { if (visible) {
@ -3843,7 +3843,6 @@ void Window_ProcessEvents(void) {
} }
static void Cursor_GetRawPos(int* x, int* y) { *x = 0; *y = 0; } static void Cursor_GetRawPos(int* x, int* y) { *x = 0; *y = 0; }
void Cursor_SetPosition(int x, int y) { }
void Cursor_SetVisible(bool visible) { } void Cursor_SetVisible(bool visible) { }
void Window_ShowDialog(const char* title, const char* msg) { void Window_ShowDialog(const char* title, const char* msg) {