From WikiChip
Editing mirc/identifiers/$keyval

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{mirc title|$keyval identifier}}'''$keyval''' returns the key code of the key being pressed inside an {{mIRC|on keydown}} or {{mIRC|on keyup}} event.
+
{{mirc title|$keyval Identifier}}'''$keyval''' return the key code of the key being pressed inside an {{mIRC|on keydown}}/{{mIRC|on keyup}} event.
 
 
'''/!\''' This identifier is filled inside {{mirc|on char}} but this is mostly for convenience and is incorrect, inside {{mirc|on char}}, it only makes sense to check for {{mirc|$keychar}}
 
  
 +
This identifier is usually used over {{mIRC|$keychar}} because $keychar returns the character itself: this is unreliable, you can't track some keys such as alt, control, non-printable character etc, they don't have a character representation.
 
== Synopsis ==
 
== Synopsis ==
 
<pre>$keyval</pre>
 
<pre>$keyval</pre>
Line 16: Line 15:
 
ON *:KEYDOWN:@myWindow:*: {
 
ON *:KEYDOWN:@myWindow:*: {
 
   clear @myWindow
 
   clear @myWindow
   drawtext @myWindow 1 3 3 Key value: $keyval
+
   drawtext @myWindow 1 3 3 Key value: $iif($keyval,$v1,NA)
 +
  drawtext @myWindow 1 3 25 Key character: $iif($keychar,$v1,NA)
 
   drawtext @myWindow 1 3 47 @myWindow Repeating: $keyrpt
 
   drawtext @myWindow 1 3 47 @myWindow Repeating: $keyrpt
}
+
}</source>
ON *:char:@myWindow:*: {
 
drawtext @myWindow 1 3 25 Key character: $keychar
 
}
 
</source>
 
  
 
The following command can now be typed into any mIRC command prompt:
 
The following command can now be typed into any mIRC command prompt:
Line 35: Line 31:
 
== Compatibility ==
 
== Compatibility ==
 
{{mirc compatibility|5.5}}
 
{{mirc compatibility|5.5}}
 
+
== See Also ==
== See also ==
+
* {{mirc|custom windows}}
 +
* {{mirc|/drawtext}}
 
* {{mirc|on keyup}}
 
* {{mirc|on keyup}}
* {{mirc|on keydown}}
 
 
* {{mirc|$keychar}}
 
* {{mirc|$keychar}}
 
* {{mirc|$keyrpt}}
 
* {{mirc|$keyrpt}}
* {{mirc|$keylparam}}
 
* [[List of identifiers - mIRC]]
 
{{mIRC identifier list}}
 
[[Category:mIRC identifiers|keyval]]
 

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)