Hi djack2,
The difficulty is that CF is a server script. So, if the client does an action, the page should be resent to the CFserver to be processed. The following demonstrates this:
(had to use 'f' because F2 is a system key, which cannot be used)
<SCRIPT TYPE="text/javascript">
<!--
function getkey(e)
{
if (window.event) { key = window.event.keyCode }
else if (e)
key = e.which
else
key = null;
if (key == '102') {
window.location.href="somePage.cfm?keyPressed="+key
}
}
//-->
</SCRIPT>
<BODY onkeypress="return getkey(event)">
Then you should use a CF code like the following:
<cfif IsDefined("url.keyPressed"

>
<cfif url.keyPressed is "102">
Code to be executed
</cfif>
</cfif>
Alas, as i said above, you cannot use system keys like F2, so i'm affraid it will not fully serve your needs. Maybe you can use Return(code 13) or space (code 32) instead?
Hope you get any further anyhow?
Kristof