x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

anyone know educational visual basic source code for HPC-2000?

1 2
msafi Page Icon Posted 2005-04-14 6:47 AM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
yay!

i finished two parts of the program
1) executing audibleplayer
2) simulating mouse clicks

but the audibleplayer refuses to let my program form come on top so that i can click the "mouse click" button and test it. but i tested the "mouse click" button with other windows and it worked.

the remaining part is the hardest part i guess.

how do i listen to inputs from the jornada's external buttons and use those inputs in my VB code?

can you help me there snappy!?

thanks,
 Top of the page
C:Amie Page Icon Posted 2005-04-14 7:21 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
18,028
Location:
United Kingdom
Status:
The audio buttons and hard buttons are all monitored and registered on the system as stnadard keyboard keys.
So all you need to know as far as I am aware is the keyboard character map references for the associated key - there is an application out there which can intercept the key clicks and tell you where it is mapped to - you just need to get the application to respond to the key stroke.
 Top of the page
msafi Page Icon Posted 2005-04-14 8:26 AM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
C:Amie - 2005-04-14 5:21 AM

there is an application out there which can intercept the key clicks and tell you where it is mapped to.

thanks for the quick reply c:amie,

do you know where i can find that application or do you even vaguely remember what it was called?

thanks!!
 Top of the page
Snappy! Page Icon Posted 2005-04-14 8:43 AM
#
Avatar image of Snappy!
H/PC Elder

Posts:
1,712
Location:
New Mexico, US
Status:
msafi - 2005-04-14 4:47 AM

yay!

i finished two parts of the program
1) executing audibleplayer
2) simulating mouse clicks


I presume it means you figured out ShellEx ya?

msafi - 2005-04-14 4:47 AM

but the audibleplayer refuses to let my program form come on top so that i can click the "mouse click" button and test it. but i tested the "mouse click" button with other windows and it worked.


At this stage, you can try "topmost" window for your app.
http://vbnet.mvps.org/index.html?code/faq/topmost.htm

That should help your app "float" up the window stack.
Note that ultimately, your app may become UI-less, so this topmost code will not be used mostly. See below.

msafi - 2005-04-14 4:47 AM

the remaining part is the hardest part i guess.

how do i listen to inputs from the jornada's external buttons and use those inputs in my VB code?


I was thinking about this the other day, and here's what I think. You can either:

1. Implement a keyboard hook (I got some source code that you can mod from. Its in C++. I'll try to do a eVB version so that you can use it directly, if you can give me 1~2days.)

2. If your device (J720?) has a macro app, and you dun mind a bit of respond lag, you can create a few macros tied to short-cut keys and launch your app. Your app would then need to be UI-less and simply fire the mouse clicks.

Method #1 is cleaner, but slightly more complex. Method #2 is slightly piece-meal, but simpler.

For #1, you may also want to have a systray icon so that you can remove it if you want.

btw, can you post a screenshot of the player you are using? Is it fullscreen?
If there are some places on the screen that is "blank", then there is a #3 solution:

#3 Have your app float ontop, and occupy a "blank" space.

That way, you dun have to worry about keyboard hooks and macros.

EDIT:

I realised that you do want to have the clicks tied to hardware keys after re-reading your posts. ...

Minor bad news ... it seem like eVB *cannot* handle commandline options ... unless with a work around:
http://www.devbuzz.com/content/zinc_evb_icon_assoc_pg1.asp

so you may want to either:

#1 Write a keyboard hook OR
#2.1 Write an app to respond to commandline (ruled out)
#2.2 Write a few apps that do different clicks?

hmmm ... getting messy ...

... can I interest you in writing it in C++? ...

Edited by Snappy! 2005-04-14 9:06 AM
 Top of the page
msafi Page Icon Posted 2005-04-14 1:24 PM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
snappy!

here are the snap shots.
picture 1: this the player. but what you are actually seeing is a ghost. you cannot click it or anything. the real player is actually in the center of the screen. it's invisible and the parts become visible as you click them. but that doesn't matter. just wanted to let you know.

picture2: this is the menu that shows up after you click on 'control'. from here i actually control everything. i never use the application's UI buttons. and this menu is what my evb application should be clicking.

did you just suggest that i should create a UI with four buttons and simply tie each of the buttons to say alt+a, alt+b and so on? then use some program like j7xxkeys to re-route the external buttons to those keys (ie alt+a, etc)?

you think that's possible?



(audibleplayer.jpg)



(audibleplayermenu.jpg)



Attachments
----------------
Attachments audibleplayer.jpg (36KB - 37 downloads)
Attachments audibleplayermenu.jpg (32KB - 39 downloads)
 Top of the page
Snappy! Page Icon Posted 2005-04-14 5:55 PM
#
Avatar image of Snappy!
H/PC Elder

Posts:
1,712
Location:
New Mexico, US
Status:
can I confirm if you want to be using hardwarekeys to control your player or buttons on the screen?
 Top of the page
msafi Page Icon Posted 2005-04-14 6:51 PM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
the idea of the program that i'm coding is to allow me to use the external buttons of the jornada to control audibleplayer...

i'm really curious what did you think i was doing?
 Top of the page
Snappy! Page Icon Posted 2005-04-14 7:23 PM
#
Avatar image of Snappy!
H/PC Elder

Posts:
1,712
Location:
New Mexico, US
Status:
msafi - 2005-04-14 4:51 PM

the idea of the program that i'm coding is to allow me to use the external buttons of the jornada to control audibleplayer...

i'm really curious what did you think i was doing?


hehehe ... initially I tot so, then I tot not, ... then I tot so ... then I tot not ... then ...

ok, in that case, a quick Proof-Of-Concept is to write one that only do one function, ie click on one of the control functions, and link it with the macro commands, just to find out if it works, and how long it takes ...
 Top of the page
msafi Page Icon Posted 2005-04-14 10:29 PM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
i cancelled all the old plans and followed snappy's advice.

i created three different programs (clickers), each one does a different function.
one for play toggle
one for rewind one minute
one for rewind ten seconds

then i used henri's j7xxkeys and linked the external keys to my three progs. everything is working smoothly now.

here's the code of rewind one minute:
--------------------------------------------
Option Explicit

' declarations for the mouse events
Public Declare Sub mouse_event Lib "coredll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal dwData As Long, ByVal dwExtraInfo As Long)

Const MOUSEEVENTF_MOVE = &H1 ' mouse move
Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Const MOUSEEVENTF_RIGHTDOWN = &H8 ' right button down
Const MOUSEEVENTF_RIGHTUP = &H10 ' right button up
Const MOUSEEVENTF_MIDDLEDOWN = &H20 ' middle button down
Const MOUSEEVENTF_MIDDLEUP = &H40 ' middle button up
Const MOUSEEVENTF_WHEEL = &H800 ' wheel button rolled
Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
Public Declare Function Sleep Lib "coredll" (ByVal lmsecs As Long) As Long

Sub Main()

RewindOneMinute

End Sub

' A left-button mouse click at pixel coords X and Y
Public Sub PerformMouseClick(ByVal X As Long, ByVal Y As Long)
Dim lFlags As Long
Dim MX As Long, MY As Long

lFlags = MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_LEFTDOWN
' Mickey coordinates needed for mouse_event range from 0 through 65535
MX = Int((65536 / 640) * X)
MY = Int((65536 / 240) * Y)

mouse_event lFlags, MX, MY, 0, 0

lFlags = MOUSEEVENTF_LEFTUP
mouse_event lFlags, 0, 0, 0, 0
End Sub

Public Sub PlayToggle()
PerformMouseClick 120, 10
Sleep 500
PerformMouseClick 120, 20
End Sub

Public Sub RewindOneMinute()
PerformMouseClick 120, 10
Sleep 500
PerformMouseClick 120, 160
Sleep 500
PlayToggle
End Sub
-------------------------------------------------

the application is formless. it runs and exits automatically once all lines have been executed.

very easy solution

thanks snappy! and everyone for the tips and help.



msafi,
 Top of the page
C:Amie Page Icon Posted 2005-04-15 7:23 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
18,028
Location:
United Kingdom
Status:
Glad you got it sorted, ad thanks for open sourcing
 Top of the page
Snappy! Page Icon Posted 2005-04-15 10:48 AM
#
Avatar image of Snappy!
H/PC Elder

Posts:
1,712
Location:
New Mexico, US
Status:
Great job msafi!

As always ... the best solution is usually uncomplicated, simple and short.
 Top of the page
msafi Page Icon Posted 2005-04-16 6:56 AM
#
Avatar image of msafi
Factorite (Elite)

Posts:
196
Location:
United States
Status:
C:Amie - 2005-04-15 5:23 AM

Glad you got it sorted, ad thanks for open sourcing

although this code is short, it's very useful. these simulated mouse clisk can be used with any program. whoever wants to use the code, all they have to figure out is the coordinates of the clicks. and they can copy/paste the code to create any sequence of clicks they want.

the code needs little cleaning though. some of the declaration statements are obviously unnecessary... but that's alright i guess...

Edited by msafi 2005-04-16 6:58 AM
 Top of the page
stingraze Page Icon Posted 2005-04-21 6:03 PM
#
Avatar image of stingraze
Subscribers
H/PC Vanguard

Posts:
3,691
Location:
Japan
Status:
nice work! will be creating test app with it asap.
 Top of the page
1 2
Jump to forum:
Seconds to generate: 0.296 - Cached queries : 53 - Executed queries : 27