KeyDown moving shapes RRS feed

  • Question

  • Hi everyone,

    I am having some trouble getting a shape to move around the screen using the arrow keys.

    Can somebody help me out with his I don't have a problem draw a shape its actually getting it to move could someone create a simple example have just moves a shape in one direction and this will help me understand how to write the rest.

    Thanks in advance.


    Tuesday, July 13, 2010 9:21 PM


  • A simple example code I have used before - Import JHD662
    • Marked as answer by Kirkkaf Tuesday, July 13, 2010 10:02 PM
    Tuesday, July 13, 2010 9:31 PM

All replies

  • A simple example code I have used before - Import JHD662
    • Marked as answer by Kirkkaf Tuesday, July 13, 2010 10:02 PM
    Tuesday, July 13, 2010 9:31 PM
  • Thanks for that example it is very helpful.


    Is there anywhere on the website I can find examples like this with there import codes?



    Tuesday, July 13, 2010 10:01 PM
  • No, it was just a similar type question I wrote it for a while back.

    The problem with these short specific examples it that it is hard to index them and point people to them quickly - I just keep the ones I have used and bring them out as needed.  Naturally, people tend to ask questions on what they are working on and not go through samples.  There was also some suggestions for creating archives of samples but it hasn't really taken off - the 'Add more details - Categories' on the Publish was part of this idea to create examples.

    For example I created a couple of longer examples (arrays (Import FCL390) and graphics (Import XZG681)) some time ago (both now maybe a bit out-of-date wrt arrays) - I don't think they are used much - perhaps too long?

    Tuesday, July 13, 2010 10:14 PM
  • Well thanks for your example.

    I think it would be a good idea to have some sort of archives for examples as it allows new people like me code to study and try understand as that is a good way for me to learn as logic is the hardest thing to learn in my opinion.

    In small basic to get key return do you just type "Space", "ESC", "CTRL" ect... or is there away to use scancodes I think I read somewhere while searching some basics use scancodes.


    Tuesday, July 13, 2010 10:59 PM
  • SmallBasic doen't use scancodes, just the names such as you listed.  Another small sample on this, Import PMW345.
    Tuesday, July 13, 2010 11:07 PM
  • Thanks for your help.


    Tuesday, July 13, 2010 11:10 PM
  • To litdev,



    Is it possible to make a "Tutorials and Examples" sub-forum in this Small Basic forum?

    The following sub-forum is a very good example,


    Perhaps the new "Tutorials and Examples" sub-forum can help many beginners(like me)..!

    Thank you very much.!

    Wednesday, July 14, 2010 9:09 AM
  • i agree to add sub-forums, my suggestion list is:

    Program Suggestions

    Tutorials and Examples

    Ongoing Projects


    Promotions & User Opinion

    |"| /"/|"""\ /"""\|"| |__ __| /\ |"""\ |"| | |/ / | " / | | || | | | / \ | |\ \ | | | |\ \ | | \ | | || |__ | | / \ | | \ \| | |_| \_\|_|\_\\___/|____| |_| /_/""\_\|_| \___|
    Wednesday, July 14, 2010 7:43 PM
  • BASIC-beginner, Kroltan,

    Currently, this forum is the best resource for SmallBasic use, esecially the 'Post your sample source code ..' threads that have a lot of diverse program codes, usually quite short and instructive.  Also, check out other peoples questions and the responses and answer them when you can, or contribute suggestions.

    Also check out the blog, wiki and other resources linked from the main SmallBasic site .

    It's not in my power to create sub forums etc.  It's also quite a lot of work to create good tutorials, especially while SmallBasic is actually changing quite a lot during its pre version 1 development.  However, I will look through the code I have and tidy/update/comment some and post them in a thread on this forum, then others can add to it as well.
    Wednesday, July 14, 2010 7:44 PM