forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Write with your mouse...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Sep 28, 2002 1:40 pm    Post subject: Write with your mouse... Reply with quote

Hi all,

I've made a program that recognises your mouse movements, and
translates them into |, /, \ or -. If you have a touch-screen somewhere,
you can use this to write on it.
You can also make something that you can enter a password with your mouse,
so that no-one can see what you're typing. A key-logger won't work either...

Well, enough talking, here is the code:

Code:

rem Make a list that will have all the characters that can be used...
list create,9
list loadtext,9
"A=/\-
"B=|//
"C=/|\
"D=|\/
"E=-|-
"F=|-/
"G=/-|
"H=|/|
"I=|||
"J=-|/
"K=|/\
"L=|--
"M=/\/
"N=|\|
"O=\-/
"P=||\
"Q=||/
"R=||-
"S=-\-
"T=--|
"U=|-|
"V=\\/
"W=\/\
"X=/-\
"Y=\//
"Z=-/-
" =---
"?=-/|

  DIALOG CREATE,Mousewriter,-1,0,437,432
  DIALOG ADD,STYLE,STYLE1,Courier New,8,,,
  DIALOG ADD,STYLE,STYLE2,Courier New,18,BC,SILVER,
  DIALOG ADD,GROUP,GROUP5,6,30,296,296
  DIALOG ADD,GROUP,GROUP4,104,226,100,100
  DIALOG ADD,GROUP,GROUP1,202,128,100,100
  DIALOG ADD,GROUP,GROUP2,6,128,100,100
  DIALOG ADD,GROUP,GROUP3,104,30,100,100
  DIALOG ADD,EDIT,EDIT1,312,30,296,92,,MULTI,WRAP,STYLE1
  DIALOG ADD,TEXT,TEXT1,312,332,100,92,@cr()START,,CLICK,STYLE2
  DIALOG ADD,EDIT,EDIT2,408,30,402,19,,,STYLE1
  DIALOG ADD,LIST,LIST1,6,332,100,296,,STYLE1
  DIALOG SHOW
list assign,list1,9
%%start = 1

:Evloop
wait event
goto @event()

:Text1click
if @equal(%%start,1)
  dialog set,text1,@cr()STOP
  %%start = 0
  wait 1
  beep
  beep
  beep
  %%characters = "   "
rem This is the minimum off pixels you must move before the script recognizes it...
  %%Space = 50
rem The wait time between 2 moves...
  %%Wait = 1
rem Name of the EDIT where the text must be in...
  %%Edit1name = EDIT1
rem Name of the EDIT where the characters must be in. You must use a proper one for this,
rem otherwise the script doesn't work... You can make this EDIT hidden...
  %%Edit2name = EDIT2

  goto Typeloop
  else
  %%start = 1
  dialog set,text1,@cr()START
  end
goto evloop
 
:Close
exit


rem ----------------------------------------
rem - Must be included in every program... -
rem ----------------------------------------
:Typeloop
gosub Firstcheck
wait %%wait

rem If you remove the rem on the next line, you can only write
rem if you have pressed you left mouse button.
rem if @mousedown(l)

gosub Secondcheck

if @equal(%%dotcount,2)
  if @not(@equal(@dlgtext(%%Edit2name),"   "))
    %%characters = "   "
    dialog set,%%Edit2name,%%characters
    beep
    beep
    end
  end

if @equal(%%char,.)
  %%dotcount = @succ(%%dotcount)
  else
  %%dotcount = 0
  %%characters = %%characters%%char
  dialog set,%%Edit2name,%%characters
  end

gosub Checkcharacter

rem Place here a END if you use the MOUSEDOWN stuff...

%%event = @event()
if @not(@null(%%event)) 
  goto %%event
  end
 
goto Typeloop

:Firstcheck
%%firstx = @mousepos(x)
%%firsty = @mousepos(y)
exit

:Secondcheck
%%secondx = @mousepos(x)
%%secondy = @mousepos(y)
rem If you want to call the Checkstuff yourselve, remove the next line and
rem place it in another place in your script...
gosub Checkmovement
exit

:Checkcharacter
list seek,9,0
rem %%var2 = @substr(%%characters,@diff(@len(%%characters),2),@len(%%characters))
if @match(9,@substr(%%characters,@diff(@len(%%characters),2),@len(%%characters)))
  %%text = %%text@substr(@substr(@item(9),1,1))
  dialog set,%%Edit1name,%%text
  %%characters = "   "
  dialog set,%%Edit2name,%%characters
  wait "0,5"
  beep
  wait "0,2"
  beep
  beep
  end
exit

:Checkmovement
if @both(@greater(%%firstx,@fadd(%%secondx,%%space)),@greater(%%firsty,@fadd(%%secondy,%%space)))@both(@greater(@diff(%%secondx,%%space),%%firstx),@greater(@diff(%%secondy,%%space),%%firsty))
  %%char = \
  exit
  end
if @both(@greater(@diff(%%secondx,%%space),%%firstx),@greater(@diff(%%firsty,%%space),%%secondy))
  %%char = /
  exit
  end
 if @both(@greater(%%firstx,@fadd(%%secondx,%%space)),@greater(%%secondy,@fadd(%%firsty,%%space)))
  %%char = /
  exit
  end
if @greater(@diff(%%secondx,%%space),%%firstx)@greater(%%firstx,@fadd(%%secondx,%%space))
  %%char = -
  exit
  end
if @greater(@diff(%%secondy,%%space),%%firsty)@greater(%%firsty,@fadd(%%secondy,%%space))
  %%char = |
  exit
  end
%%char = .
exit


EDIT1: Made a change in list 9 so that there are no charactersthe same...


Last edited by Skit3000 on Sat Sep 28, 2002 5:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Sep 28, 2002 1:55 pm    Post subject: Reply with quote

That's really cool, Skit! Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Sat Sep 28, 2002 2:19 pm    Post subject: Re: Write with your mouse... Reply with quote

Hey skit, just wanted to point out you have A and C equalling the same character set. Very cool idea.

skit3000 wrote:

"A=/\-
"B=|//
"C=/\-


Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sat Sep 28, 2002 5:33 pm    Post subject: Reply with quote

I've changed that one Mark...

Btw. I knew that there were some misstakes in that list, but I hadn't got the time to fix that...
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Oct 02, 2002 5:18 pm    Post subject: Reply with quote

Here is an example of how to use this script. Maybe it's even possible to use upper and lower case characters...

Code:

list create,9
list loadtext,9
"A=/\-
"B=|//
"C=/|\
"D=|\/
"E=-|-
"F=|-/
"G=/-|
"H=|/|
"I=|||
"J=-|/
"K=|/\
"L=|--
"M=/\/
"N=|\|
"O=\-/
"P=||\
"Q=||/
"R=||-
"S=-\-
"T=--|
"U=|-|
"V=\\/
"W=\/\
"X=/-\
"Y=\//
"Z=-/-
" =---
"?=-/|
  DIALOG CREATE,Mousewriter,47,51,104,48,ONTOP,NOMIN
  DIALOG ADD,EDIT,EDIT1,312,30,296,92,,MULTI,WRAP
  DIALOG ADD,EDIT,EDIT2,2,0,104,19
  DIALOG ADD,BUTTON,Startstop,24,0,104,24,Start / Stop
  DIALOG SHOW
%%start = true
:evloop
wait event
goto @event()
:Startstopbutton
if @equal(%%start,true)
  %%characters = "   "
  %%Space = 50
  %%Wait = 1
  %%Edit1name = EDIT1
  %%Edit2name = EDIT2
  %%start = false
  goto Typeloop
  else
  %%start = true
  goto evloop
  end
:Close
exit
:Typeloop
gosub Firstcheck
wait %%wait
gosub Secondcheck
if @equal(%%dotcount,2)
  if @not(@equal(@dlgtext(%%Edit2name),"   "))
    %%characters = "   "
    dialog set,%%Edit2name,%%characters
    beep
    beep
    end
  end
if @equal(%%char,.)
  %%dotcount = @succ(%%dotcount)
  else
  %%dotcount = 0
  %%characters = %%characters%%char
  dialog set,%%Edit2name,%%characters
  end
gosub Checkcharacter
end
%%event = @event()
if @not(@null(%%event)) 
  goto %%event
  end
goto Typeloop
:Firstcheck
%%firstx = @mousepos(x)
%%firsty = @mousepos(y)
exit
:Secondcheck
%%secondx = @mousepos(x)
%%secondy = @mousepos(y)
gosub Checkmovement
exit
:Checkcharacter
list seek,9,0
if @match(9,@substr(%%characters,@diff(@len(%%characters),2),@len(%%characters)))
window send,@winactive(),@substr(@substr(@item(9),1,1))
  %%text = %%text@substr(@substr(@item(9),1,1))
  dialog set,%%Edit1name,%%text
  %%characters = "   "
  dialog set,%%Edit2name,%%characters
  wait "0,5"
  beep
  wait "0,2"
  beep
  beep
  end
exit
:Checkmovement
if @both(@greater(%%firstx,@fadd(%%secondx,%%space)),@greater(%%firsty,@fadd(%%secondy,%%space)))@both(@greater(@diff(%%secondx,%%space),%%firstx),@greater(@diff(%%secondy,%%space),%%firsty))
  %%char = \
  exit
  end
if @both(@greater(@diff(%%secondx,%%space),%%firstx),@greater(@diff(%%firsty,%%space),%%secondy))
  %%char = /
  exit
  end
 if @both(@greater(%%firstx,@fadd(%%secondx,%%space)),@greater(%%secondy,@fadd(%%firsty,%%space)))
  %%char = /
  exit
  end
if @greater(@diff(%%secondx,%%space),%%firstx)@greater(%%firstx,@fadd(%%secondx,%%space))
  %%char = -
  exit
  end
if @greater(@diff(%%secondy,%%space),%%firsty)@greater(%%firsty,@fadd(%%secondy,%%space))
  %%char = |
  exit
  end
%%char = .
exit
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group