! This first set of cursor movement commands simulates EDT-like movement, ! but the cursor position is figured on character count, not screen ! position. This results in jerky vertical movement when working with ! lines that have tab characters. ! ! The second set of commands, eve_rigid_*, use the alternate TPU built ! in commands to achieve rigid movement based on screen position. ! The two procedures rigid_cursor and normal_cursor switch the key ! definitions between the two sets of procedures. procedure eve_move_left move_horizontal (-1); endprocedure; ! eve_move_left ! Move right one column. Do not wrap at edge of the screen. procedure eve_move_right move_horizontal (1); endprocedure; ! eve_move_right procedure eve_move_up move_vertical (-1); endprocedure; ! eve_move_up procedure eve_move_down move_vertical (1); endprocedure; ! eve_move_down ! Page 34 ! Cursor motion procedures (copied from EVESECINI.TPU, renamed) ! Move down one row, staying in the same column. Scroll if necessary. procedure eve_rigid_down if get_info (current_window, eve$kt_current_row) = get_info (current_window, "visible_bottom") then scroll (current_window, 1); else cursor_vertical (1); endif; endprocedure; ! Move left one column. Do not wrap at edge of the screen. procedure eve_rigid_left cursor_horizontal (-1); endprocedure; ! Move right one column. Do not wrap at edge of the screen. procedure eve_rigid_right cursor_horizontal (1); endprocedure; ! Move up one row, staying in the same column. Scroll if necessary. procedure eve_rigid_up if get_info (current_window, eve$kt_current_row) = get_info (current_window, eve$kt_visible_top) then scroll (current_window, -1); else cursor_vertical (-1); endif; endprocedure; !- ! This procedure will set the scrolling to be 3 lines from the top and ! bottom of the window, and will place the cursor 3 lines from the top ! or bottom of the window after the scrolling is done. It must be run ! (or the command must be issued) each time a window is mapped, with ! the window that scrolling will be effective for as the second ! parameter of the command. !+ procedure eve_scrolling set(scrolling,current_window,on,3,3,1); endprocedure; ! eve_scrolling procedure eve_rigid_cursor define_key("eve_rigid_left",left,"Rigid_left"); define_key("eve_rigid_right",right,"Rigid_right"); define_key("eve_rigid_up",up,"Rigid_up"); define_key("eve_rigid_down",down,"Rigid_down"); endprocedure; procedure eve_normal_cursor define_key("eve_move_left",left,"Move_left"); define_key("eve_move_right",right,"Move_right"); define_key("eve_move_up",up,"Move_up"); define_key("eve_move_down",down,"Move_down"); endprocedure;