Home - Forums - Documentation - Gallery - Bugs
(New page: = Checking an event = csKeyEventHelper.GetCookedCode(ev) raw = csKeyEventHelper.GetRawCode(ev) * cooked means modifiers are applied (shift+a == 'A') * raw is just the key (shift+a ==...)
Line 1: Line 1:
 +
 +
= Querying for a component =
 +
 +
 +
<source lang="python">
 +
 +
VirtualClock = object_reg.Get(iVirtualClock)
 +
 +
</source>
 +
 +
= Checking an event =
= Checking an event =
-
csKeyEventHelper.GetCookedCode(ev)
+
<source lang="python">
 +
 
 +
cooked = csKeyEventHelper.GetCookedCode(ev)
raw = csKeyEventHelper.GetRawCode(ev)
raw = csKeyEventHelper.GetRawCode(ev)
 +
 +
</source>
 +
* cooked means modifiers are applied (shift+a == 'A')
* cooked means modifiers are applied (shift+a == 'A')
* raw is just the key (shift+a == 'a')
* raw is just the key (shift+a == 'a')
 +
 +
 +
= Checking time =
 +
<source lang="python">
 +
 +
elapsed = VirtualClock.GetElapsedTicks()
 +
absolute = VirtualClock.GetCurrentTicks()
 +
 +
</source>
 +
 +
elapsed is the time elapsed since last call
 +
absolute time elapsed since the start

Revision as of 20:06, 25 March 2009

Querying for a component

VirtualClock = object_reg.Get(iVirtualClock)


Checking an event

cooked = csKeyEventHelper.GetCookedCode(ev)
 raw = csKeyEventHelper.GetRawCode(ev)


* cooked means modifiers are applied (shift+a == 'A')
* raw is just the key (shift+a == 'a')


Checking time

elapsed = VirtualClock.GetElapsedTicks()
 absolute = VirtualClock.GetCurrentTicks()

elapsed is the time elapsed since last call absolute time elapsed since the start

| Article | Discussion | View source | History |