arrow-keys

Press left and right arrow to change image?

99封情书 提交于 2019-12-03 22:13:55
问题 So I have this simple slideshow: <div class="container"> <div id="slideshow"> <img alt="slideshow" src="1.jpg" id="imgClickAndChange" onclick="changeImage()" /> </div> </div> I have managed to make the images change when I click like this: <script language="javascript"> var imgs = ["2.jpg", "3.jpg", "4.jpg", "5.jpg"]; function changeImage() { document.getElementById("imgClickAndChange").src = imgs[0]; imgs.push(imgs.shift()) } </script> The problem is I also want the images to change when I

Is it possible to use arrow keys in OCaml interpreter?

泄露秘密 提交于 2019-12-03 04:48:07
Everytime I use these keys in the interpreter I keep getting symbols like this appearing: [[D^[[C I'm using Linux Mint 12 in ZSH, however I'm getting the same result in Ubuntu with bash. Also, same thing in ssh. The stock OCaml toplevel doesn't have line editing built in. I use rlwrap : $ cat bin/ocaml #!/bin/sh exec rlwrap /usr/local/bin/ocaml "$@" Using the toplevel without something like this is quite painful, in my opinion! Other possibilities are to run the toplevel under emacs (a popular choice, I think), or to use utop . I haven't used utop, but it sounds cool. Another option is to use:

How to speed up the left and right arrow keys for editing text? [closed]

China☆狼群 提交于 2019-12-03 04:00:38
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is it just me, or do other people find that the left and right arrow keys on MacOS are unusually slow for editing text? Compared to my Windows machines, positioning the cursor with left/right arrow keys seems to take twice as long on the Mac. The up/down arrows seem to be speedy enough, but left/right arrows

jQuery UI Autocomplete DownArrow UpArrow

纵然是瞬间 提交于 2019-12-02 22:06:11
I am having some issues with jQuery Autocomplete and moving DownArrow and UpArrow ? The problem seems to be that <input id="autocomplete-input" value=""> focus: function (event, ui) { $('#autocomplete-input').val(ui.item.label); } This works great for MOUSE focus - but when I use arrowUp and arrowDown - it selects the ui.item.id over and above the ui.item.label How can I fix this so that either: the input val isn't changed at all [i.e. it keeps the users inputted term] it updates the input val with the focused val the user is on with keydown/keyup thanks Andrew Whitaker Make sure to prevent

How to speed up the left and right arrow keys for editing text? [closed]

情到浓时终转凉″ 提交于 2019-12-02 17:22:28
Is it just me, or do other people find that the left and right arrow keys on MacOS are unusually slow for editing text? Compared to my Windows machines, positioning the cursor with left/right arrow keys seems to take twice as long on the Mac. The up/down arrows seem to be speedy enough, but left/right arrows just crawl. I notice it the most in Terminal, editing recently used commands, and I'm noticing it right now while text in a browser form. Is there a Mac preference I can set to speed up the response to these keys? Vadim To change how fast a key repeats when holding it down , adjust this

Arrow keys turn into control characters in Telnet

落爺英雄遲暮 提交于 2019-12-02 14:34:27
问题 I'm in an Ubuntu terminal, and telnet to a server. Now whenever I type 'up', it turns into ^[[A. Other arrow keys also turn into control characters. Is there a way I can run telnet so it understands my arrow keys? This would be a huge help because I'd like to scroll up in my commands history. 回答1: It's not telnet that needs to understand the escape sequences your keys produce; it's whatever program you're typing them into at the remote end. Looks like your $TERM environment variable (on the

Handling arrow keys in a Form

狂风中的少年 提交于 2019-12-02 12:54:32
问题 I have just found out that we can't use the KeyDown event directly with a PictureBox . So I have to change my strategy. I decided to add the Keydown event to the actual form: private void FullColourPaletteForm_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Left: { MessageBox.Show("Left"); e.Handled = true; return; } } } Doesn't get executed. I see no message box when I press the left allow. Instead (and rightly so) it just moves the cusor from control to control. I

Determining escape sequences for cursor keys canonically

馋奶兔 提交于 2019-12-02 12:02:13
问题 I'd like to react on cursor keys; for this I want to find out the escape sequences the current terminal is using in a canonical way. Most solutions just have the strings "\e[A" etc. in the source code. I understand that this is not portable in case the target system uses a different escape sequence. I tried using tput to get the proper escape sequence but tput kcud1 returns a different escape sequence than what is used for the down arrow key: It returns "\eOB" but the key results in "\e[B" .

Arrow keys turn into control characters in Telnet

痴心易碎 提交于 2019-12-02 10:23:02
I'm in an Ubuntu terminal, and telnet to a server. Now whenever I type 'up', it turns into ^[[A. Other arrow keys also turn into control characters. Is there a way I can run telnet so it understands my arrow keys? This would be a huge help because I'd like to scroll up in my commands history. It's not telnet that needs to understand the escape sequences your keys produce; it's whatever program you're typing them into at the remote end. Looks like your $TERM environment variable (on the remote system) is not getting set correctly for the terminal you're running telnet in. It's been a while

Determining escape sequences for cursor keys canonically

耗尽温柔 提交于 2019-12-02 06:55:38
I'd like to react on cursor keys; for this I want to find out the escape sequences the current terminal is using in a canonical way. Most solutions just have the strings "\e[A" etc. in the source code. I understand that this is not portable in case the target system uses a different escape sequence. I tried using tput to get the proper escape sequence but tput kcud1 returns a different escape sequence than what is used for the down arrow key: It returns "\eOB" but the key results in "\e[B" . But no capname given to tput results in this string; the best I can manage is tput cud which returns "