Author |
Message |
harishmabish
|
Posted: Sat Mar 29, 2008 4:23 pm Post subject: There's no KEY_ button for the spacebar? |
|
|
Why?!!!!! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
richcash
|
Posted: Sat Mar 29, 2008 4:31 pm Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
Probably because you can just represent it by this :
or chr (32) |
|
|
|
|
![](images/spacer.gif) |
harishmabish
|
Posted: Sat Mar 29, 2008 5:24 pm Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
im a noob, im sorry |
|
|
|
|
![](images/spacer.gif) |
DaveAngus
![](http://compsci.ca/v3/uploads/user_avatars/121496826447fbae72bc179.gif)
|
Posted: Sun Mar 30, 2008 8:54 pm Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
Haha everyone has to learn it at some point. |
|
|
|
|
![](images/spacer.gif) |
The_Bean
![](http://compsci.ca/v3/uploads/user_avatars/8459755754b4009cee84e9.jpg)
|
Posted: Sun Mar 30, 2008 9:28 pm Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
if you want to you can add it in for yourself
just go to
C:\Program Files\Turing\Support\predefs\Keyboard.tu
or where ever you have your turing program files
right after
const KEY_CTRL_UNDERSCORE : char := chr (31)
you need to add in
const KEY_SPACE : char := chr (32)
then you can use KEY_SPACE as it after you save the .tu file
Turing: |
var chars : array char of boolean
loop
Input.KeyDown(chars )
exit when chars (KEY_SPACE )
end loop
|
|
|
|
|
|
![](images/spacer.gif) |
Boiq
|
Posted: Mon Sep 29, 2008 7:19 am Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
The_Bean @ Sun Mar 30, 2008 9:28 pm wrote: if you want to you can add it in for yourself
just go to
C:\Program Files\Turing\Support\predefs\Keyboard.tu
or where ever you have your turing program files
right after
const KEY_CTRL_UNDERSCORE : char := chr (31)
you need to add in
const KEY_SPACE : char := chr (32)
then you can use KEY_SPACE as it after you save the .tu file
Turing: |
var chars : array char of boolean
loop
Input.KeyDown(chars )
exit when chars (KEY_SPACE )
end loop
|
True, but if you submit a file to others people will only be able to run it properly if they made that adjustment too, otherwise there spacebar would not function for anything. |
|
|
|
|
![](images/spacer.gif) |
SNIPERDUDE
![](http://compsci.ca/v3/uploads/user_avatars/16932914504cbd0ad6ceaf1.jpg)
|
Posted: Mon Sep 29, 2008 10:53 am Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
The_Bean @ Sun Mar 30, 2008 9:28 pm wrote: True, but if you submit a file to others people will only be able to run it properly if they made that adjustment too, otherwise there spacebar would not function for anything.
That's only if you're submitting the code. Compiling it should be fine.
I've made the same adjustment a good while back. |
|
|
|
|
![](images/spacer.gif) |
Dan
![](http://wiki.compsci.ca/images/archive/3/3c/20100325043407!Danspic.gif)
|
Posted: Mon Sep 29, 2008 12:43 pm Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
Editing the standard libarys for a langue is never a good idea (unless you plan on making a new version of them and realseing them).
It would make more sence to make your own libary of functions, modules and constnets you find usefull and disbtruit that with your code. |
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Ktomislav
![](http://compsci.ca/v3/uploads/user_avatars/208162377548d53ef771951.jpg)
|
Posted: Mon Sep 29, 2008 4:46 pm Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
code: |
var chars :array char of boolean
loop
Input.KeyDown(chars)
exit when chars(' ')
end loop |
|
|
|
|
|
![](images/spacer.gif) |
S_Grimm
![](http://compsci.ca/v3/uploads/user_avatars/18926424384e6d86e5cf4d6.jpg)
|
Posted: Tue Sep 30, 2008 10:17 am Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
Ktomislav has got the easiest way. there is no editing of libraries, and Dan, not all these people know how to create a library and distribute it. |
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Tue Sep 30, 2008 11:04 am Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
Turing: |
unit
module Foo
export Bar
function Bar (baz : string)
return baz
end Bar
end Foo
|
Then just save it as a .tu file and whenever you use that module with any program you wish to share as source, simply include that file with the rest of your code. Simple, really. |
|
|
|
|
![](images/spacer.gif) |
SNIPERDUDE
![](http://compsci.ca/v3/uploads/user_avatars/16932914504cbd0ad6ceaf1.jpg)
|
Posted: Tue Sep 30, 2008 3:25 pm Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
Like my GUI as a perfect example. |
|
|
|
|
![](images/spacer.gif) |
The_Bean
![](http://compsci.ca/v3/uploads/user_avatars/8459755754b4009cee84e9.jpg)
|
Posted: Tue Sep 30, 2008 4:57 pm Post subject: Re: There's no KEY_ button for the spacebar? |
|
|
The reason behind it wasn't to have him mess up his Keyboard.tu file, he was just asking why there wasn't so I showed him to add it in if he wanted.
I also have my own .tu file with stuff like SetAngle and NthRoot
But I added it to the Predefs.lst in the support folder and put it with the others so i don't have to import it every time. |
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: Tue Sep 30, 2008 4:59 pm Post subject: RE:There\'s no KEY_ button for the spacebar? |
|
|
As Dan pointed out, modifying the pre-defined files that come with the IDE is a very poor idea, unless you are creating your own version that you plan to redistribute at large. Sure, having your own personal Predefs list is good and all, but what happens when you want to distribute your code, and forget to add that import in your program? |
|
|
|
|
![](images/spacer.gif) |
|