Computer Science Canada help changing [Input.Keydown] function |
Author: | That Asian Guy [ Fri Nov 02, 2007 3:23 pm ] |
Post subject: | help changing [Input.Keydown] function |
whenever i use the Input.Keydown command, my keys are read even if i hold it down. how do i change this so tht the pressed key is only detected once, even if it is held? thx |
Author: | Euphoracle [ Fri Nov 02, 2007 5:44 pm ] |
Post subject: | RE:help changing [Input.Keydown] function |
Create an array of your last KeyDown and crossref it. If they are both true, it is being held down. If the last one is false, it is a new keypress. If the current one is false, well, it was released. |
Author: | That Asian Guy [ Fri Nov 02, 2007 6:38 pm ] |
Post subject: | RE:help changing [Input.Keydown] function |
well im really new to turing, just learning it at school. so can u please post a little snippet of what i should do? and btw is there another way to do it? wht if the two presses of the same key are required? |
Author: | Mazer [ Fri Nov 02, 2007 9:06 pm ] |
Post subject: | Re: RE:help changing [Input.Keydown] function |
That Asian Guy @ Fri Nov 02, 2007 6:38 pm wrote: wht if the two presses of the same key are required?
Are you really expecting the user to press a key, release it, and press it again all within the span of a single frame? I think you are safe. |