Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 22, 2008 4:35:21 GMT -5
Hi Guilect,
I wanted just to write a Input routine. However, I have remarked that we do not have any query for it. I need something which an ASCII sign delivers back .
The routine should look so:
Public Name
Sub KeyInput() Dim a Do a = Key.GetAsc (Key.GetAsc without key repeating) iF a >= "a" and a <= "z" and Len(Name) < 8 Then Name = Name & Ucase(a) Text Name,128,128 End iF Loop Until Key.Pressed(vk_return) End Sub
Key.GetAsc have to be made first!
|
|
|
Post by Guilect on Sept 22, 2008 7:10:23 GMT -5
This line of code will return the ASCII value of a key press :
ret = dll.CallAPI("user32", "MapVirtualKeyA", key.pressedany(), 1)
here is an example program.
option explicit
dim bRunning bRunning = True
dim background, Font
sub main()
if (graphics.initialize <> True) then exit sub
Font = graphics.CreateFont("system", 24) graphics.setTitle "Demo - Keyboard - press [ESC] to exit" key.initialize do while bRunning = True
if key.pressed(1) or key.pressed(0) = True then bRunning = False graphics.clear 255 graphics.settext Chr(dll.CallAPI("user32", "MapVirtualKeyA", key.pressedany(), 1)), 200,200, Font graphics.display loop key.terminate graphics.terminate
end sub
Call Main()
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 22, 2008 9:53:59 GMT -5
sure, but unfortunately have I no full version! dll is unknown here.
|
|
|
Post by u9 on Sept 23, 2008 15:56:53 GMT -5
It's only 10 bucks Anyways, if that's too much, you can have a look at the input methods I have used in A Square's Life. I mapped each wk_? key to their corresponding ascii value, so basically you can make the getasc() function yourself
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 23, 2008 17:37:15 GMT -5
Hi, it's not too much ! Already done
Thank you u9.
|
|