From 3233d488610f22f40fb73565b3cd4bbe60bb3851 Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Mon, 12 Feb 2018 14:59:14 +0300 Subject: [PATCH] code text selection --- src/code.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/code.c b/src/code.c index 37e3732..5c1bd74 100644 --- a/src/code.c +++ b/src/code.c @@ -996,6 +996,8 @@ static void processGestures(Code* code) static void processMouse(Code* code) { + tic_mem* tic = code->tic; + if(checkMousePos(&code->rect)) { setCursor(tic_cursor_ibeam); @@ -1024,16 +1026,16 @@ static void processMouse(Code* code) char* position = code->cursor.position; setCursorPosition(code, x + code->scroll.x, y + code->scroll.y); - // if(SDL_GetModState() & KMOD_SHIFT) - // { - // code->cursor.selection = code->cursor.position; - // code->cursor.position = position; - // } - // else if(!code->cursor.mouseDownPosition) - // { - // code->cursor.selection = code->cursor.position; - // code->cursor.mouseDownPosition = code->cursor.position; - // } + if(tic->api.key(tic, tic_key_shift)) + { + code->cursor.selection = code->cursor.position; + code->cursor.position = position; + } + else if(!code->cursor.mouseDownPosition) + { + code->cursor.selection = code->cursor.position; + code->cursor.mouseDownPosition = code->cursor.position; + } } else {