<doc>
  <legacy_id>1803</legacy_id>
  <name>rawKeyDown</name>
  <type>message</type>
  <syntax>
    <example>rawKeyDown <i>keyCode</i></example>
  </syntax>
  <library></library>
  <objects>
    <field/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>User Interaction</category>
  </classification>
  <references>
    <function tag="keysDown">keysDown Function</function>
    <message tag="optionKeyDown">optionKeyDown Message</message>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent when the user presses any key.</summary>
  <examples>
    <example>on rawKeyDown theKeyNumber</p><p>  if theKeyNumber is 65308 then increaseScroll <code><i>-- mouse wheel down</i></code></p><p>  else if theKeyNumber is 65309 then decreaseScroll <code><i>-- mouse wheel up</i></code></p><p>  else pass rawKeyDown <code><i>-- don't forget this!</i></code></p><p>end rawKeyDown</example>
  </examples>
  <description>
    <p>Handle the <b>rawKeyDown</b> <keyword tag="message box">message</keyword> if you want to intercept raw <glossary tag="event">events</glossary> from the keyboard, or from a mouse wheel, or if you want to handle keys that aren't mapped to any <keyword tag="character">character</keyword>.</p><p/><p><b>Parameters:</b></p><p>The <i>keyCode</i> is the raw <glossary tag="keycode">keycode</glossary> of the pressed key.</p><p/><p><b>Comments:</b></p><p>If the <b>rawKeyDown</b> <glossary tag="handler">handler</glossary> does not <control_st tag="pass">pass</control_st> the <keyword tag="message box">message</keyword> or send it to a further <glossary tag="object">object</glossary> in the <glossary tag="message path">message path</glossary>, the keypress has no effect. <glossary tag="pass">Passing</glossary> the <keyword tag="message box">message</keyword> allows the keypress to have its normal effect.</p><p/><p>If the <b>rawKeyDown</b> <keyword tag="message box">message</keyword> is sent as the result of a keypress, the <keyword tag="message box">message</keyword> is sent to the <glossary tag="active control">active (focused) control</glossary>, or to the <glossary tag="current card">current card</glossary> if no <keyword tag="control">control</keyword> is <glossary tag="focus">focused</glossary>.</p><p/><p>A <b>rawKeyDown</b> <keyword tag="message box">message</keyword> is also sent when the user moves the mouse wheel on a scrolling mouse; in this case, the <keyword tag="message box">message</keyword> is sent to the <keyword tag="control">control</keyword> under the <glossary tag="mouse pointer">mouse pointer</glossary>.</p><p/><p>If the insertion point is in a field, the entry of typed characters is triggered by the <b>rawKeyDown</b> <keyword tag="message box">message</keyword>. This means that <glossary tag="trap">trapping</glossary> the <b>rawKeyDown</b> <keyword tag="message box">message</keyword> and not <glossary tag="pass">Passing</glossary> it prevents typing from being entered in the <keyword tag="field">field</keyword>.</p><p/><p><code/><img src="202652"/> <b>Cross-platform note:</b><code/> On <glossary tag="Mac OS">Mac OS systems</glossary>, no <keyword tag="message box">message</keyword> is sent when a <glossary tag="modifier key">modifier key</glossary> (Shift, Option, Control, or Command) is pressed, unless another key is pressed along with the <glossary tag="modifier key">modifier key</glossary>. Mouse wheels do not send a <b>rawKeyDown</b> <keyword tag="message box">message</keyword> on <glossary tag="Mac OS">Mac OS systems</glossary>.</p>
  </description>
</doc>