Changes

Jump to navigation Jump to search

Overview of the API

12 bytes removed, 21:22, 20 May 2011
Line 246: Line 246:  
*'''on.charIn'''(string) is called when the Nspire detects a non arrow key being pressed. ch is the character it detect. If you want to auto start an event in the file linked to key r(like a reset) put on.charIn(“r”) where you want. This Lua program lets you display the value of a valid non arrow key :
 
*'''on.charIn'''(string) is called when the Nspire detects a non arrow key being pressed. ch is the character it detect. If you want to auto start an event in the file linked to key r(like a reset) put on.charIn(“r”) where you want. This Lua program lets you display the value of a valid non arrow key :
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
  c = “”
+
  c = ""
 
  function on.charIn(ch)
 
  function on.charIn(ch)
 
  c = ch
 
  c = ch
Line 252: Line 252:  
  end
 
  end
 
  function on.paint(gc)
 
  function on.paint(gc)
  gc:setFont(“sansserif”, “r”, 10)
+
  gc:setFont(“sansserif”, "r", 10)
  gc:drawString(c, 0, 0, “top”)
+
  gc:drawString(c, 0, 0, "top")
 
  end
 
  end
 
</syntaxhighlight>
 
</syntaxhighlight>
30

edits

Navigation menu