<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6603.0">
<TITLE>JSAPI - Keyboard Event Handlers</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Good day lists, </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Well I am implementing some accessibility options on our map in development here and I have a question</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The compaspoint (pan arrows). Is their a jsapi function to engage these buttons? </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Perhaps I am being a bit lazy, instead of looking thru the .js file that handles CWCButton. However if someone has </FONT>
<BR><FONT SIZE=2 FACE="Arial">already came across this it could save me some time. :)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I need to trigger the Locate widget and the compaspoint widgets via JS or any button for that matter. </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Included is my js routine that shows you what I have done already</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks list. </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Paul. </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"><script language=javascript></FONT>
<BR><FONT SIZE=2 FACE="Arial"><!--</FONT>
<BR><FONT SIZE=2 FACE="Arial">// add a listener. </FONT>
<BR><FONT SIZE=2 FACE="Arial">document.onkeydown = keyListener; </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">//Wrapper for IE</FONT>
<BR><FONT SIZE=2 FACE="Arial">function keyListener(e){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(!e){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> //for IE</FONT>
<BR><FONT SIZE=2 FACE="Arial"> e = window.event;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">// MAP SIZE key:1 -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==49){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> changeMapSize('s',<? echo $_mapSize["s"]["width"] ?>, <? echo $_mapSize["s"]["height"] ?>);</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial">// MAP SIZE key:2 -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==50){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> changeMapSize('m',<? echo $_mapSize["m"]["width"] ?>, <? echo $_mapSize["m"]["height"] ?>); </FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
<BR><FONT SIZE=2 FACE="Arial">// MAP SIZE key:3 -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==51){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> changeMapSize('l',<? echo $_mapSize["l"]["width"] ?>, <? echo $_mapSize["l"]["height"] ?>); </FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
<BR><FONT SIZE=2 FACE="Arial"> // MAP ZOOM OUT key: O -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==79){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> goCWCJSAPI.oMap.ZoomOut();</FONT>
<BR><FONT SIZE=2 FACE="Arial"> }</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">// MAP ZOOM IN key:I -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==73 ){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> goCWCJSAPI.oMap.ZoomIn();</FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
<BR><FONT SIZE=2 FACE="Arial">// MAP ZOOM ALL key:A -------------</FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==65 ){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> goCWCJSAPI.oMap.ZoomFull();</FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> // MAP PRINT key: P ------------- </FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==80){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> printerFriendly('<? echo strtolower($_itemType); ?>');</FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
<BR><FONT SIZE=2 FACE="Arial"> // MAP HELP key: H ------------- </FONT>
<BR><FONT SIZE=2 FACE="Arial"> if(e.keyCode==72){</FONT>
<BR><FONT SIZE=2 FACE="Arial"> document.location.href= '<? echo $_basePath?>/cesiHelp.php?lang=<? echo $lang?>';</FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<BR>
<BR>
<P><B><FONT SIZE=2 FACE="Arial">Paul Deschamps, UI Design / Graphic Artist</FONT></B>
<BR><SPAN LANG="fr-ca"><FONT SIZE=2 FACE="Arial">Integrated Environmental Applications Branch / Direction des Applications Environnementales Intégrés</FONT></SPAN><SPAN LANG="en-us"></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">Knowledge Integration Directorate / Direction g</FONT></SPAN><SPAN LANG="fr-ca"><FONT SIZE=2 FACE="Arial">énérale de l'integration du savoir</FONT></SPAN>
<BR><SPAN LANG="fr-ca"><FONT SIZE=2 FACE="Arial">Environment Canada / Environnement Canada</FONT></SPAN><SPAN LANG="en-us"></SPAN><SPAN LANG="en-us"></SPAN>
<BR><SPAN LANG="en-us"><FONT SIZE=2 FACE="Arial">70 Cr</FONT></SPAN><SPAN LANG="fr-ca"><FONT SIZE=2 FACE="Arial">émazie, 7th Floor / 7<SUP>e</SUP> étage</FONT></SPAN>
<BR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Gatineau, Québec K1A 0H3</FONT></SPAN>
<BR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">Tel / Tél:</FONT></SPAN><SPAN LANG="en-ca"><B><FONT SIZE=2 FACE="Arial"> (819) 934-2986</FONT></B></SPAN>
<BR><SPAN LANG="en-ca"><FONT SIZE=2 FACE="Arial">E-mail / Courriel:</FONT><B> <FONT SIZE=2 FACE="Arial">Paul.Deschamps@ec.gc.ca</FONT></B></SPAN><B><SPAN LANG="en-us"></SPAN></B><SPAN LANG="en-us"></SPAN>
</P>
</BODY>
</HTML>