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.
+
The '''$keyval''' identifier is filled during an [[on keydown - mIRC|ON KEYDOWN]], or an [[on keyup - mIRC|ON KEYUP]] event inside of a [[custom windows - mIRC|custom @window]].
 
 
'''/!\''' 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}}
 
  
 
== Synopsis ==
 
== Synopsis ==
Line 10: Line 8:
  
 
== Example ==
 
== Example ==
Create an alias that launches a custom, {{mirc|picture window}} which listens for key presses and displays the key value pressed, the key character pressed, and if it is repeating:
+
Create an alias that launches a custom, [[picture windows - mIRC|picture window]] which listens for key presses and displays the key value pressed, the key character pressed, and if it is repeating:
 
<source lang="mIRC">alias keyDownTest {
 
<source lang="mIRC">alias keyDownTest {
 
   window -p $+ $iif($window(@myWindow),ra) @myWindow 550 300 250 105
 
   window -p $+ $iif($window(@myWindow),ra) @myWindow 550 300 250 105
Line 16: Line 14:
 
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 31: Line 26:
 
[[File:Keyup event.png|This screenshot shows an example of the ON KEYDOWN event custom example.]]
 
[[File:Keyup event.png|This screenshot shows an example of the ON KEYDOWN event custom example.]]
  
Note that this makes use of a {{mirc|picture window}}, as well as the {{mirc|/drawtext|drawtext command}}. These types of {{mirc|picture windows|windows}} and their tools can be very powerful in creating some amazing graphical layouts, as well as mIRC games.
+
Note that this makes use of a [[picture windows - mIRC|picture window]], as well as the [[/drawtext command - mIRC|drawtext command]]. These types of [[picture windows - mIRC|windows]] and their tools can be very powerful in creating some amazing graphical layouts, as well as mIRC games.
  
 
== Compatibility ==
 
== Compatibility ==
{{mirc compatibility|5.5}}
+
Added: mIRC v5.5
 +
08/01/99 - mIRC v5.5
 +
Added On: 08/01/99
  
== See also ==
+
== See Also ==
* {{mirc|on keyup}}
+
* [[custom windows - mIRC|Custom Windows]]
* {{mirc|on keydown}}
+
* [[/drawtext command - mIRC|/drawtext]]
* {{mirc|$keychar}}
+
* [[on keyup - mIRC|ON KEYUP]]
* {{mirc|$keyrpt}}
+
* [[$keychar identifier - mIRC|$keychar]]
* {{mirc|$keylparam}}
+
* [[$keyrpt identifier - mIRC|$keyrpt]]
* [[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)