AutoHotkey Community

It is currently May 26th, 2012, 10:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 24th, 2009, 2:38 am 
Offline

Joined: October 24th, 2009, 1:56 am
Posts: 7
In this case, your substitution solved the problem, but try this:


0::
SetTitleMatchMode 2
IfWinNotActive, OpenOffice.org
{
send, .
}
Else
{
send, 0
}
return

This is the code I need, except with 0 instead of NumpadDot.
The above script is called when 0 is pressed. If calc is active, pressing zero will make the script press zero, but instead of inputing a zero, it will call the script started by zero. We need a way to make the 0 key work as if there was no script when called by the else statement.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 2:44 am 
Offline

Joined: May 22nd, 2007, 1:06 am
Posts: 73
Dragobr wrote:
In this case, your substitution solved the problem, but try this:


$0::
SetTitleMatchMode 2
IfWinNotActive, OpenOffice.org
{
send, .
}
Else
{
send, 0
}
return

This is the code I need, except with 0 instead of NumpadDot.
The above script is called when 0 is pressed. If calc is active, pressing zero will make the script press zero, but instead of inputing a zero, it will call the script started by zero. We need a way to make the 0 key work as if there was no script when called by the else statement.


Put that dollar sign infront of your activating key


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 2:47 am 
Offline

Joined: October 24th, 2009, 1:56 am
Posts: 7
Phew, that did it.

There might be more efficient solutions, but I will stick with this for now.

Thanks a lot for helping :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 10:28 am 
Offline

Joined: October 2nd, 2009, 12:43 pm
Posts: 283
Code:
SetTitleMatchMode 2
#IfWinActive, OpenOffice.org
$NumpadDot::NumpadDot
#IfWinActive
$NumpadDot::.

This should work.
No loops.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: November 13th, 2009, 4:52 am 
<!-- its Working---->
<html>
<heaD>
<script language="javascript">
function keypress1 ()
{
var e=window.event || e
unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode==46)
{ return (e.charCode ? e.charCode=44 : e.keyCode=44); }
}
function keypress2 ()
{
var e=window.event || e
unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode==46)
{ return (e.charCode ? e.charCode=46 : e.keyCode=46); }
}
function keyDown(e)
{
if (!e){
e = event
}
var code=e.keyCode;
if(code==110)
return document.onkeypress=keypress1
else if(code=188)
{ document.onkeypress=keypress2 }
}
document.onkeydown = keyDown
</script>
</head>
<body>
<input type=text>
</body>
</html>
--Savvy


Report this post
Top
  
Reply with quote  
PostPosted: November 13th, 2009, 5:05 am 
<html>
<heaD>
<script language="javascript">
function keypress1 ()
{
var e=window.event || e
unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode==46)
{ return (e.charCode ? e.charCode=44 : e.keyCode=44); }
}
function keypress2 ()
{
var e=window.event || e
unicode = e.charCode ? e.charCode : e.keyCode;
if (unicode==46)
{ return (e.charCode ? e.charCode=46 : e.keyCode=46); }
}
function keyDown(e){
if (!e){
e = event
}
var code=e.keyCode;
if(code==110)
return document.onkeypress=keypress1
else if(code=188)
{ document.onkeypress=keypress2 }
}
document.onkeydown = keyDown
</script>
</head>
<body>
<input type=text>
</body>
</html>


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, Bing [Bot], hyper_, JSLover, Leef_me, patgenn123, rbrtryn, XstatyK and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group