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 


VDS5 basics hate me, wonder why SHIFT wont work...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 9:13 pm    Post subject: VDS5 basics hate me, wonder why SHIFT wont work... Reply with quote

VDS5 basics hate me Cool

Thanks for looking, below I have a simple example that shows that I can not get the (hold down)SHIFT key to work thru Window SEND.

Maybe I'm doing something wrong again Laughing

The result I am looking for when the below program is ran and done, I want all items to be selected(BLUE).

But instead, it just jumps from begining to end, home and etc..

Code:
DIALOG CREATE,test shift,-1,0,202,202,,CLASS testshift

DIALOG ADD,LIST,filebox1,1,1,200,200,,MULTI

DIALOG SHOW

LIST loadtext,filebox1
"one
"two
"three
"four
"five
"six
"seven

wait 1

LIST seek,filebox1,0
rem   %%control_identifier = @winatpoint(9,9)

wait 1

dialog focus,filebox1
window send,#testshift,@shift(@key(END))

:Evloop
wait event
goto @event()

:Close
EXIT


API DSU DLL would be great SOLUTION also.

Thanks for your time Wink
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 9:45 pm    Post subject: Reply with quote

I added some DDE code Laughing

Code:
my DDE failed lol


Last edited by vtol on Sat Sep 08, 2007 5:59 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 10:02 pm    Post subject: Reply with quote

That didnt work, I think its the LINK name is wrong, but have no clue how to do it.
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 10:36 pm    Post subject: Reply with quote

After searching the forum, This dont work either.

Code:
I deleted this code, never worked


Last edited by vtol on Sat Sep 08, 2007 5:58 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 10:40 pm    Post subject: Reply with quote

hmm, nevermind...

Last edited by vtol on Sat Sep 08, 2007 5:57 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 10:50 pm    Post subject: Reply with quote

I googled this up if it helps:

Code:
Framework BRL.Blitz

Const KEYEVENTF_KEYUP = $00000002
Const VK_MENU = $12 ' the ALT key
Const VK_F1 = $70
Const VK_F = $46

Extern "Win32"
   Function keybd_event(bVK:Byte,bScan:Byte,dwFlags:Int,dwExtraInfo:Int)
End Extern

keybd_event(VK_MENU,0,0,0) ' press the ALT key
keybd_event(VK_F,0,0,0) ' press the F key for the FILE menu
keybd_event(VK_F,0,KEYEVENTF_KEYUP,0) ' let up the F key
keybd_event(VK_MENU,0,KEYEVENTF_KEYUP,0) ' let up the ALT key

' comment the ALT block and uncomment this to do the HELP.
' F1 wont fire If the FILE menu is open which is the result of the above strokes

'keybd_event(VK_F1,0,0,0) ' fire the F1 help
'keybd_event(VK_F1,0,KEYEVENTF_KEYUP,0) ' let up the F1 key


well I think thats all I can do, hope someone can help me get the END key to working $23 on previous EXAMPLE, thanks again Confused
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Fri Sep 07, 2007 11:34 pm    Post subject: Reply with quote

Code:
This on did'nt work - so I removed its uglyness


Last edited by vtol on Sat Sep 08, 2007 5:55 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Sep 08, 2007 1:46 am    Post subject: Reply with quote

Glad we were all able to help you there Wink Hehehehehe
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sat Sep 08, 2007 4:56 am    Post subject: Reply with quote

Actually, it works intermittingly.
But I found the posible problem.
(1) If I press the right shift with my finger, it lets off the Right SHIFT(which gets stuck on).
(2) If I make sure the NumLock light is off, it lets off the Right SHIFT(which gets stuck on).

So I added another version below, but now I need a way to detect if the NumLock is ON. (seems like I used to know how to do that - I forget)

Code:
title TEST
 dialog CREATE,TEST,-1,0,300,150,CLASS testshift
 dialog ADD,LIST,LIST1,10,10,280,110,,MULTI
 dialog ADD,BUTTON,BUTTON1,123,120,,,Go!
 dialog ADD,BUTTON,numlock,123,10,,,NumLock

dialog SHOW

window send,#testshift,@key(num)

LIST loadtext,LIST1
"one
"two
"three
"four
"five
"six
"seven

LIST seek,LIST1,0
wait 1
 
:evloop
  wait event
  goto @event()

:numlockBUTTON
window send,#testshift,@key(num)
goto evloop

:BUTTON1BUTTON
dialog focus,LIST1
LOADLIB user32
%%Right_SHIFT_key = $0A1
%%END_key = $23

#    Hold down Right Shift key
%x = @lib(user32,keybd_event,NULL:,INT:%%Right_SHIFT_key,INT:0,INT:0,INT:0)
#    END key
%x = @lib(user32,keybd_event,NULL:,INT:%%END_key,INT:0,INT:0,INT:0)

#    Let Keys Up
%x = @lib(user32,keybd_event,NULL:,INT:%%END_key,INT:0,INT:$002,INT:0)
%x = @lib(user32,keybd_event,NULL:,INT:%%Right_SHIFT_key,INT:0,INT:$002,INT:0)
FREELIB user32
goto evloop

:CLOSE
EXIT


This one works all the time, if you make sure NumLock light is off before clicking GO! button Sad

Hi Garret, good to see ya...


Last edited by vtol on Sat Sep 08, 2007 5:51 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sat Sep 08, 2007 5:48 am    Post subject: Reply with quote

If someone has the key problems, then this may help.
I got it so its fully automatic now and hopefully done.

WARNING~~~CONTAINS API(found here - thankyou)

Code:
title TEST
 dialog CREATE,TEST,-1,0,300,150,CLASS testshift
 dialog ADD,LIST,LIST1,10,10,280,110,,MULTI
 dialog ADD,BUTTON,BUTTON1,123,120,,,Go!
 dialog ADD,BUTTON,numlock,123,10,,,NumLock
 dialog disable,numlock

dialog SHOW


LOADLIB USER32
%I = @lib(user32,GetKeyState,int:,$90)
%%numlock_state = neutral
IF @equal(%I,1)
 window send,#testshift,@key(num)
 %%numlock_state = on
ELSE
 %%numlock_state = off
END

LIST loadtext,LIST1
"one
"two
"three
"four
"five
"six
"seven

LIST seek,LIST1,0
wait 1

 
:evloop
  wait event
  goto @event()


:BUTTON1BUTTON
dialog focus,LIST1
%%Right_SHIFT_key = $0A1
%%END_key = $23
#    Hold down Right Shift key
%x = @lib(user32,keybd_event,NULL:,INT:%%Right_SHIFT_key,INT:0,INT:0,INT:0)
#    END key
%x = @lib(user32,keybd_event,NULL:,INT:%%END_key,INT:0,INT:0,INT:0)

#    Let Keys Up
%x = @lib(user32,keybd_event,NULL:,INT:%%END_key,INT:0,INT:$002,INT:0)
%x = @lib(user32,keybd_event,NULL:,INT:%%Right_SHIFT_key,INT:0,INT:$002,INT:0)
goto evloop


:CLOSE
#  BELOW PUTS NUMLOCK BACK WAY IT WAS...
IF @equal(%%numlock_state,on)
 window send,#testshift,@key(num)
END
FREELIB USER32

EXIT


Sorry I made another forum mess Embarassed
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sat Sep 08, 2007 3:20 pm    Post subject: Reply with quote

Vtol,
Your original code worked fine on my PC? Instead of sending the keyboard commands to the Dialog why not send them to the Listbox directly?

Code:

DIALOG CREATE,test shift,-1,0,202,202,,CLASS testshift

DIALOG ADD,LIST,filebox1,1,1,200,200,,MULTI

DIALOG SHOW

LIST loadtext,filebox1
"one
"two
"three
"four
"five
"six
"seven

wait 1

LIST seek,filebox1,0
rem   %%control_identifier = @winatpoint(9,9)

wait 1

dialog focus,filebox1
window send,@winexists(~filebox1),@shift(@key(END))

:Evloop
wait event
goto @event()

:Close
EXIT

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
uvedese
Contributor
Contributor


Joined: 21 Jan 2006
Posts: 169
Location: Spain

PostPosted: Sun Sep 09, 2007 4:54 pm    Post subject: Reply with quote

Hi vtol: Very Happy

I have proved another easy solution. It works in my PC:

Code:
title TEST
  dialog CREATE,TEST,-1,0,300,150,CLASS testshift
  dialog ADD,LIST,LIST1,10,10,280,110,,MULTI
  dialog ADD,BUTTON,BUTTON1,123,120,,,Go!
  dialog SHOW
 
  option decimalsep,.

  LIST loadtext,LIST1
"one
"two
"three
"four
"five
"six
"seven

:evloop
  wait event
  goto @event()

:BUTTON1BUTTON
  dialog focus,LIST1
  list seek,list1,0
  wait .02
  window send,@winexists(~list1),@ctrl(@shift(@key(END)))
  goto evloop

:CLOSE
EXIT


Good luck
_____________

uVeDeSe
______________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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