Skip to content
Eric Draut edited this page Mar 8, 2016 · 4 revisions

Key Bindings

<a href="go_forward" <%= bind_key_attrs("right") %>>forward</a>

In this example, pressing the right arrow key will click the forward link.

<%= ajax_link 'backward' go_back_path, bind_key("left"), '#some_target' %>

In this example, pressing the left arrow key will click the backward link, submitting it via Thin Man ajax (requires Thin Man).

These are the keys you can bind:

backspace
tab
return
return
shift
ctrl
alt
pause
capslock
esc
space
pageup
pagedown
end
home
left
up
right
down
insert
del
;
=
0
1
2
3
4
5
6
7
8
9
*
+
-
.
/
f1
f2
f3
f4
f5
f6
f7
f8
f9
f10
f11
f12
numlock
scroll
-
;
=
,
-
.
/
`
[
\
]
Clone this wiki locally