What are the keyboard arrow left and right keys called

NightCrawler

Diamond Member
Oct 15, 2003
3,179
0
0
If I use a letter it works fine but I can't seem to figure what the proper name is for the left and right arrow keys are called.
 

farmercal

Golden Member
Mar 23, 2000
1,580
0
0
Right arrow is called "Right Arrow"
Left arrow is called "Left Arrow"

Not trying to be a smart@ss but what else could they be called? Are you looking for a fancy name like ampersand?
 

NightCrawler

Diamond Member
Oct 15, 2003
3,179
0
0
It's for Gallery software, when using letters it works fine. I can go foward and backwards using the n and m buttons but figuring out the arrow keys is harder.
 

BigToque

Lifer
Oct 10, 1999
11,700
0
76
I think he means that he wants to know what the keycode for the left and right key are so he can check if a user pressed that key.
 

NightCrawler

Diamond Member
Oct 15, 2003
3,179
0
0
<script language="JavaScript"> function getkey(e) {

if (e == null) { // ie
keycode = event.keyCode;
} else { // mozilla
keycode = e.which;
}
key = String.fromCharCode(keycode).toLowerCase();
switch(key) {
case "n": top.frames['parent'].location='<?php echo makeAlbumUrl($gallery->session->albumName, $navigator['allIds'][$navpage+1]) ?>'; return false; //next
case "b": top.frames['parent'].location='<?php echo makeAlbumUrl($gallery->session->albumName, $navigator['allIds'][$navpage-1]) ?>'; return false; //previous

case " ": top.frames['mainFrame'].location='<?php echo makeAlbumUrl($gallery->session->albumName, $navigator['allIds'][$navpage+1]) ?>'; return false; //ne
xt
}
return true;

}

document.onkeypress = getkey; </script>



<?php } # if not embedded ?>
<?php
includeHtmlWrap("photo.header");
?>
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
maybe if you make it display the keycode for the key you press you can find the keycode


edit: the direction keys give me 0 :Q
 

NightCrawler

Diamond Member
Oct 15, 2003
3,179
0
0
Maybe it's just not officially supported keys or something. Do all keyboards have the 4 arrow keys ?


I was pretty sure they were standard keys.