AutoHotkey Community

It is currently May 27th, 2012, 9:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: December 2nd, 2011, 2:02 am 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
great ! ball works almost fine , the trouble is the mouse pointer( arrow) moves all over the screen when i move the ball


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 2:09 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
I wasn't aware you didn't also want native functionality of the ball.
Let me see....

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 2:13 am 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
sorry for not being precise, thank you again

those key combinations that im trying to emulate with your help are for a specific design application .
all those functions were made by a dedicated trackball who for the moment is damaged and im trying to fix(not sure i will succed fixing it) it and after that to capture exact codes for each key .
for the moment keys combinations is all i got and need to apply them to any suitable trackball i found on the market.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 4:59 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
The key combos are the easiest part of this,
thats why I'm saving them for last.

For me to block the trackball
while maintaining its functionality,
I have to employ the ClipCursor API function
with a dirty negative offset hack on the RECT struct.
( a true 1px clip would disable the ability for the trackball to work at all ).

Its coming along,
will post as soon as its "safe" to use ;)

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 4:24 pm 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
playing around with that freakin ball i inserted usb plug in another usb slot and ball stopped executing emulated movements.
same result connecting trk. to another pc.

1st usb slot tbNm = \??\HID#Vid_04d9&Pid_1135#7&81300d4&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
2nd usb slot tbNm = \??\HID#Vid_04d9&Pid_1135#7&1ACCB179&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}

replacing 1st name with 2nd one ball workin on 2nd slot.
multiple names can be added ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2011, 8:06 pm 
yea shouldnt be too hard I can take a look @ this when @ my AHK comp.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2011, 11:58 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
Give this a run
Code:
gui, +lastfound
gH := winExist(), cnt:=!!cnt, tStmp := a_tickcount
AHKHID_UseConstants(), OnMessage( 0xff, "inputMsg" )
AHKHID_Register( 1, 2, gH, RIDEV_INPUTSINK )

devNms= ; add to the device list between below brackets
(
\??\HID#Vid_04d9&Pid_1135#7&81300d4&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
\??\HID#Vid_04d9&Pid_1135#7&1ACCB179&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
)

tbNm := subStr((st:=regexReplace( devNms, "\n+(?=.*\\)", "|" )), 1, strLen( st )-1 )

return

inputMsg( wParam, lParam ) {
  local devNm := AHKHID_GetDevName( AHKHID_GetDevIndex( AHKHID_GetInputInfo( lParam, II_DEVHANDLE  )))

  if ( regexMatch( devNm, tbNm ) ) {
    coordmode, mouse, screen
    while !((a_tickcount - tStmp) > 1000 ) {
      cnt++, pCnt:=cnt-1
      mouseGetPos, mx%cnt%, my%cnt%
      send % ( mx%cnt%>mx%pCnt% ? "{shift down}{wheeldown}"
           :   mx%cnt%<mx%pCnt% ? "{shift down}{wheelup}"
           :   my%cnt%>my%pCnt% ? "{wheeldown}"
           :   my%cnt%<my%pCnt% ? "{wheelup}" : "{shift up}" )
    }
    tStmp:=a_tickcount, cnt:=!!cnt
    send {shift up}
  }
}
Let me know how this works out.
It still doesnt address blocking trackball movement during action.
Working on it..

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2011, 2:30 am 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
good news : pluged in to 2nd usb slot ,reload the script(its alright if we cant make a self refresh) and it works
i think it will work for any valid name added to the list


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2011, 9:40 pm 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
script can work with a shorter name?
mean like that:
\??\HID#Vid_04d9&Pid_1135
thinkin that way is no need to add a name for each usb port used
just asking, no rush....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2011, 1:55 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
walther wrote:
script can work with a shorter name?
All tests indicate that the shorter names are still matched so yea its ok.
Just make sure theres \ @ the start and the names are on separate lines.

As for the refresh issue, I think the register function might have to be called again via the onMessage ( per mouse action ).
The only thing is I'm not sure how safe it would be to add a register call under the onMessage function call.
Could cause a serious crash.

Let me make sure.

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 5th, 2011, 4:42 pm 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
i just let a shorter single line for name like that:
\??\HID#Vid_04d9&Pid_1135
ant it works on any usb port on any pc, reloading the script still needed when changing usb port .
but thats not so important.
most important is to get rid of pointer ,to test ball movement in drawing field .
waiting.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2011, 3:59 pm 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
any news?


Last edited by walther on January 6th, 2012, 12:37 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 3rd, 2012, 3:11 pm 
Offline

Joined: November 26th, 2011, 5:07 pm
Posts: 20
dont know what happened to TLM . passed 1 month and no response at all.
anybody can help me from this point ?

thank you


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, migz99 and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group