j-ulrich / jquery-simulate-ext

jQuery simulate extended
https://j-ulrich.github.io/jquery-simulate-ext/
Other
146 stars 48 forks source link

No support to simulate up and down arrow keys #31

Closed szilardd closed 9 years ago

szilardd commented 9 years ago

Left and right arrow keys can be simulated using {leftarrow} and {rightarrow}, but not up and down arrow keys.

I have tried to extend the script with {downarrow} by sending keycode 40, but it doesn't work.

Is this a browser issue ? Thanks

j-ulrich commented 9 years ago

Sorry for the late reply.

I assume that "it doesn't work" means moving the text cursor up and down does not work. The {leftarrow} and {rightarrow} sequences use the browsers selection API to manipulate the selection. Unfortunately, the selection API is based on characters and does not respect the representation of the text. So word wrapping due to the size of the box is not respected in the selection API and hence it is not reliably possible to move the cursor up and down.