home *** CD-ROM | disk | FTP | other *** search
- export int MouseMark(int mode)
- {
- int x, y;
-
- x = ReadInfo("mouse_x");
- y = ReadInfo("mouse_y");
- SetInfo(-1, "cursor_marking", 0);
- if (mode)
- {
- BlockMark(0);
- PlaceCursor(x, y);
- }
- else if (x >= 0 && y >= 0)
- {
- BlockMark(1);
- PlaceCursor(x, y);
- }
- }
-
- export int MouseMark2()
- {
- SetInfo(-1, "cursor_marking", 0);
- BlockMark(1);
- PlaceCursor(ReadInfo("mouse_x"), ReadInfo("mouse_y"));
- BlockMark(1);
- }
-
- export int MouseMarkDouble()
- {
- string str = GetLine();
- int x;
- int y = 0;
-
- SetInfo(-1, "cursor_marking", 1);
- CursorRightWord();
- CursorLeftWord();
- x = ReadInfo("byte_position");
-
- while(Isword(str[x++])) y++;
-
- BlockMark(1);
- CursorRight(y);
- BlockMark(1);
- SetInfo(-1, "cursor_marking", 0);
- }
-
- export int MM_BlockHook()
- {
- if (!ReadInfo("cursor_marking"))
- {
- BlockMark(0);
- return (0);
- }
- }
-
- export int MM_OutputHook()
- {
- BlockDelete();
- return(0);
- }
-
- /* Mouse Drag assigns */
- AssignKey("MouseMark(1);", "MouseLeft");
- AssignKey("MouseMark(0);", "MouseLeftDrag");
- AssignKey("BlockMark(2);", "MouseLeftUp", "block_exist");
-
- /* Doubleclick marks a word */
- AssignKey("MouseMarkDouble();", "MouseLeftDouble");
-
- /* Mouse buttons for cut, copy & paste */
- AssignKey("BlockPaste();", "ctrl MouseLeft");
- AssignKey("BlockCopy();", "MouseRight");
- AssignKey("BlockCut();", "ctrl MouseRight");
-
- /* Shift + Left button marks from cursor */
- AssignKey("MouseMark2();", "Shift MouseLeft");
-
- /* Output clears the marked block */
- Hook("Output", "MM_OutputHook();", "block_exist");
-
- /* Cursor movements removes the block marking */
- Hook("CursorUp", "MM_BlockHook();", "block_exist");
- Hook("CursorDown", "MM_BlockHook();", "block_exist");
- Hook("CursorLeft", "MM_BlockHook();", "block_exist");
- Hook("CursorRight", "MM_BlockHook();", "block_exist");
- Hook("CursorLeftWord", "MM_BlockHook();", "block_exist");
- Hook("CursorRightWord", "MM_BlockHook();", "block_exist");
- Hook("PageUp", "MM_BlockHook();", "block_exist");
- Hook("PageDown", "MM_BlockHook();", "block_exist");
- Hook("Backspace", "MM_OutputHook(); return(1);", "block_exist");
- Hook("Delete", "MM_OutputHook(); return(1);", "block_exist");
-
- /* This hack makes it possible for us to mark with Amiga b as usual */
- ConstructInfo("cursor_marking", "", "", "LBH", "", 0, 1);
- SetInfo(-2, "cursor_marking", 0);
- AssignKey("SetInfo(-1, \"cursor_marking\", 1); BlockMark();", "Amiga b");
-