Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to Navigate a Title Screen with arrow keys
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
brownni




PostPosted: Thu Jan 26, 2012 9:14 pm   Post subject: How to Navigate a Title Screen with arrow keys

What is it you are trying to achieve?
My teacher said my project has to include key navigation, the only place i can put it is on the title screen, but i have no idea how to make key down arrow select the font option and actually enter into the window it opens


What is the problem you are having?
i dont know where to start :/


Describe what you have tried to solve this problem
Their is nothing i could try i just dont know how Sad



Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Velocity




PostPosted: Thu Jan 26, 2012 11:01 pm   Post subject: RE:How to Navigate a Title Screen with arrow keys

Please exp.lain in more detail what you need help with.
Beastinonyou




PostPosted: Fri Jan 27, 2012 9:21 am   Post subject: Re: How to Navigate a Title Screen with arrow keys

You should elaborate more on what you currently have on the Title screen, and what exactly you're having troubles with, code-wise

From the sentence of information, I can infer that you need to include keyboard input on your title screen, and you have some Font Option.

By "and actually enter into the window it opens", I assume that on your Title screen, you have an option that has a list of fonts of some-sort, and the user can select the font they want. This selection process is in a different window than the title screen, so when the user selects the Font Option, it proceeds to the selection phase, and will resume back when the user has selected a font.

So, using key navigation (Input.KeyDown, hasch, getch), if the user presses the Down Arrow (chr (208)), it would highlight the Font Options area / button. To enter into the Font Selection window, you could then say, If the user is highlighted / navigated to the Font Options, and Presses the Space Bar (ord (" ")), it would then enter the Font Selection window / draw Font Selection Screen.

You could navigate entirely using keys on the keyboard.

For using the Down Arrow key to select / deselect the Font Options, you could perhaps glance at this pseudo:

Turing:
var selectFont : boolean := false

if (downArrowKeyPressed) = true then  % Check if the user pressed the Down Arrow Key (Pseudo-Code)
     if selectFont = false then     % Toggles the selection. If they press it once, it selects. If they press it again, it De-Selects
          selectFont := true
     else
          selectFont := false
     end if
end if

if selectFont = true then
     % Draw something to indicate highlighted option
     if (spaceBarPressed) = true then     % Check whether the user pressed a key that indicates they wish to Proceed into Selection (Pseudo)
          fontSelectionMenu    % A Procedure that could draw a new screen with Font Options selectable by the User
     end if
end if

It should also be Noted that this is just a simple way of selecting one option. For numerous options and navigating using the Down Arrow Key, you would have to Cycle through them.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: