Browse code

Added alt-click selection

neauoire authored on 10/03/2021 18:00:43
Showing 2 changed files
... ...
@@ -14,7 +14,7 @@ WITH REGARD TO THIS SOFTWARE.
14 14
 
15 15
 #include "uxn.h"
16 16
 
17
-#define HOR 48
17
+#define HOR 64
18 18
 #define VER 32
19 19
 #define PAD 2
20 20
 #define RES (HOR * VER * 16)
... ...
@@ -5,7 +5,6 @@
5 5
 		- Follow cursor when moving out of the screen
6 6
 		- Save/Load
7 7
 		- Real scrolling distance
8
-		- Page up/down move with ctrl+arrow
9 8
 		- Double-click select word
10 9
 		- Right-click find next instance of selection
11 10
 		- Copy/Cut/Paste
... ...
@@ -61,7 +60,7 @@ BRK
61 60
 
62 61
 	,ctrl-end ~dev/ctrl #00 EQU ~lock #00 NEQ #0000 NEQ2 JMP? POP2
63 62
 
64
-		( lock ) #04 =lock
63
+		( lock ) #03 =lock
65 64
 
66 65
 		,no-ctrl-up ~dev/ctrl #10 NEQ JMP? POP2
67 66
 			( clamp ) ,no-ctrl-up ~position.y #0000 EQU2 JMP? POP2
... ...
@@ -105,6 +104,14 @@ BRK
105 104
 		@no-alt
106 105
 		( ctrl )
107 106
 		,no-ctrl ~dev/ctrl #0f AND #01 NEQ JMP? POP2
107
+			,no-cup ~dev/ctrl #04 ROR #01 NEQ JMP? POP2
108
+				~scroll.y #0004 SUB2 =scroll.y
109
+				,redraw JSR ,ctrl-end JMP
110
+			@no-cup
111
+			,no-cdown ~dev/ctrl #04 ROR #02 NEQ JMP? POP2
112
+				~scroll.y #0004 ADD2 =scroll.y
113
+				,redraw JSR ,ctrl-end JMP
114
+			@no-cdown
108 115
 			,no-cleft ~dev/ctrl #04 ROR #04 NEQ JMP? POP2
109 116
 				,goto-linestart JSR ,redraw JSR ,ctrl-end JMP
110 117
 			@no-cleft
... ...
@@ -197,9 +204,9 @@ RTS
197 204
 	~dev/mouse.y #0008 DIV2 ~scroll.y ADD2 =position.y
198 205
 	~dev/mouse.x ~textarea.x1 SUB2 #0007 ADD2 #0007 DIV2 =position.x
199 206
 
200
-	,touch-when ~dev/mouse.state ~touch.state NEQ JMP? POP2
207
+	,touch-when ~dev/mouse.state ~touch.state NEQ ~dev/ctrl #0f AND #02 NEQ #0101 EQU2 JMP? POP2
201 208
 		( on drag )
202
-		,find-selection JSR =selection.to
209
+		,find-selection JSR #0001 ADD2 =selection.to
203 210
 		,clamp-selection JSR
204 211
 		,redraw JSR
205 212
 		,touch-end JMP