locked
More tutorials RRS feed

  • General discussion

  • I'm still kinda new to programming, and i find Small Basic pretty easy to use but I'm not catching on completely...seems like I could use a few more tutorials/guides =). For example, I'm trying to make a small drawing program where you can select pre-set colors by pressing keys 1 through 9 (and 0), but I'm having a hard time understanding how to use GraphicsWindow.Keydown to do this..or is there no way to have the program know what key the user has pressed/selected as of yet? Anyway, still a complete newbie with programming :D I've went through the whole introduction to small basic PDF, was pretty easy to understand the things it went over..it's just seems like it's missing a lot more how-to's. (Maybe provide examples for each event, etc?)
    Tuesday, November 11, 2008 3:44 AM

All replies

  • SubZero,

    You can check out the PaintProgram.sb sample that is installed in the Samples folder (%Documents%\Small Basic\Samples).  This sample uses the GraphicsWindow.LastKey property to change the color of the pen, while handling the GraphicsWindow.KeyDown event.
    Tuesday, November 11, 2008 12:34 PM
  •  You can use the following:

    IF (GraphicsWindow.LastKey = "Right") Then
    <commands>
    EndIF

    to use the right arrow key.  "Left" is the left arrow, "Down" is the down arrow and "Up" is the up arrow.
    • Edited by Ziggurattt Thursday, November 13, 2008 4:36 PM
    Thursday, November 13, 2008 4:29 PM