switch enter to shift+enter
hi every body
sorry for my bad english
i have a contenteditable P tag
i want to change enter event on keydown to shift+enter
but when i change e.shiftkey=true take error
can you help me ?
Otherwise, you might try attaching a mousedown handler to the <p> tag's parent node, and when the key code of the event is the shift key, set a variable to true on the page.
Next, you'll need a keypress event on the same DOM node. When the keypress event fires, and the key code is 13 (which I believe is the keycode for the ENTER key) and the shift key flag is true, then you know that the SHIFT + ENTER combo was used.
Lastly, you'll need a keyup event on the same DOM node to set the shift key variable to false.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)