I am looking for a terminal command or script or program which moves the text cursor in whichever text field currently has focus. Something like:
move_cursor 1
which would move the cursor one column to the right. The reason is that I would like to define keyboard shortcuts which execute this command so I can have keyboard control of the cursor.
Since I am using this with keyboard shortcuts, keyboard event solutions won't work, for example
xdotool key --clearmodifiers Right
in principle does what I am asking, but since the command will be executed when other keys are depressed, it doesn't really work well.
The behavior I am looking for is similar to the GTK+ Keybinding Theme setting (org.gnome.desktop.interface.gtk-key-theme
) which can be set to 'Emacs'
so that, for example, ctrl-f
moves the cursor right one column, ctrl-b
moves back one column, ctrl-d
deletes the character to the right of the cursor, etc. I just want different keybindings.
xdotool sleep 0.3 key Right
it worked.. but i know sleep time is a big negative here..