Trackball Scrolling

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
rast
New User
Posts: 2
Joined: Thu Oct 27, 2011 3:58 am

Trackball Scrolling

Post by rast »

Hi,

First of all, this seems like a great little utility. Thanks for writing it and making it freeware!
I've searched the help and forums but haven't found a solution to what I'm trying to do, so this is probably a feature request (otherwise please push me in the right direction).

I have a trackball without a scroll wheel. Under Linux I have set it up so that I can push Button 4 on the mouse and use the trackball itself as a scrollwheel. This is very convenient and even better than a scroll wheel because the trackball has a greater range of motion.

I'm trying to do this with X-Mouse Button Control but can't find a way to assign anything to the trackball/mouse motion. I'm imagining this would be useful for things other than scrolling too (eg volume control, etc).

I found MarbleScroll (http://simans.net/marble/) which does exactly what I want, but it says it isn't maintained anymore and doesn't work correctly on 64-bit systems. XMBC seem to have excellent maintenance, and tons of additional feature, so a lot of user of MarbleSroll would be happy migrators I think.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

It certainly is a feature request, and not a bad one at that :)

It's going to be quite a big change internally but I will see what I can do, but please don't expect it to be in version 2.3 which I am pretty much ready to roll out. Once I have done so, I will think about putting this into v2.4.

Would you be OK with a new item in the button dropdown to enable this mode, so you configure that for whatever button you like, and while the button is held down, it intercepts X/Y and translates to vertical/horizontal scroll messages? That will be the easy option :)

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
rast
New User
Posts: 2
Joined: Thu Oct 27, 2011 3:58 am

Re: Trackball Scrolling

Post by rast »

Thanks for considering it for v2.4. I'm happy with whatever is the easiest solution for you to implement. Personally I'd want it to work exactly like you described: Enter scrolling mode when a button is pressed and leave it when the button is released.

If I understood correctly then there would be an additional entry for scrolling in the drown down list, that I can activate for a particular button. This would then be only active in that particular Layer where I select this. This would cover my use case perfectly. I wonder though if for other user it might be better and more flexible to have the X axis and the Y axis available as additional points in the configuration list (like Left Button, Right Button, etc), and a new drop down list for each axis.

This way I would need to configure Layer 1 to have default behavior for both axis, and Layer 2 to map the X axis to horizontal scrolling and the Y axis to vertical scrolling. Then I'd map a Mouse button 4 to switch to layer 2 (and possible an additional keyboard button). In Layer 3 I'd map volume to X/Y if such an option would ever become available.

Thinking about it I'm not sure if it's actually more flexible, but it does feel a bit more logical to have the physical X/Y input of a trackball/mouse in the same list as all other physical input signals (Left Button, Right Button, Middle Button, Wheel Up, Wheel Down, X Axis, Y Axis, etc).

Having said that, I'm only getting to learn to know XMBC and happy with whatever solution you see fits best.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

I wonder though if for other user it might be better and more flexible to have the X axis and the Y axis available as additional points in the configuration list (like Left Button, Right Button, etc), and a new drop down list for each axis.
I thought about that initially and then I realised, that as the scrolling is already configurable for left right up and down, that I should not need to add X and Y actions, which would be a bit of a nightmare and could cause performance issues (due the the amount of mouse X/Y messages you get) I think.

So for now, I will add an item to the dropdown like "Convert movement to scroll" or something like that which will, when pressed, convert X/Y to vertical/horizontal which can then be configured by setting stuff in the existing scroll and tilt dropdowns.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Pukat
New User
Posts: 7
Joined: Wed Nov 09, 2011 2:02 am

Re: Trackball Scrolling

Post by Pukat »

Hello!

I think I made a comment that should be here in the first place.

So here it goes.
As I said in other post, I'm in modding mice stuff and converting them to trackballs.
My last is a Verbatim laser Bluetooth mouse that works fine in Windows 7 x64 based laptop.
Since the trick is to have a wireless trackball, I used this mouse to do the job, so I only needed some software to program the other 3 buttons (thanks for XMBC) and some trick to invert the Y and the X axis on the system in order to use it as a trackball.
I have some code to do this job, there are some software outthere that does the job too (Sakasa mouse p.e.) but it should be wonderful to get it in XMBC.

That trick I implement uses a dll to hook the mouse movement and let the program to do its job freelly. Its programmed on Rad Studio 2009 and I think it could be used on .NET but I'm not sure.

Once I have the chance to post Images I'll share the whole idea.

Thanks again for XMBC.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

OK you should be able to post images now.

For the X/Y invert axis, did you just invert the X and Y in the DLL hook? or did you have to intercept the movement and then inject new movement with SendInput or the likes? XMBC uses hooks so if your program was able to do it then I guess XMBC will have no problem.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

Rast,

I have added "Change movement to scroll" in 2.3 beta 8, get it here.
Give it a try and let me know if it works or not.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

I don't suppose you have tried 2.3 b8 yet? I need to gauge if the change works for you before I release 2.3?

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
skipcube
New User
Posts: 6
Joined: Wed Nov 23, 2011 7:12 am

Re: Trackball Scrolling

Post by skipcube »

Hi Phil,
I was really impressed by XMBCs capabilities. And scroll feature for trackball is one something which would be a great addition and I would appreciate it.

I tried v2.3.9 and the latest 2.3 release version. None of these versions seem to work. Here's what I observed:
1. The mouse I have is Logitech Trackman Marble. It has 4 buttons. Buttons 3, 4 is for back and forward.
2. XMBC detects only 4th button click as Mouse Button 5.
3. When I set the action to "Change Movement to Scroll" , click apply, and press the button, nothing happens. If set the action to anything else, that action is executed.
4. XMBC is detecting the click though.

Can you please let know if this feature is enabled? If not, I can test out any beta releases you might have.

Thanks.
Skip
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

You are holding the button down yes?

This is a new feature I squeezed into 2.3 and was not tested by the requester above so, while it worked for me, it is quite possible that its not quite right or not working how people want/expect it to work.

If you are holding the button down, then maybe if you can enable and send me some debug log it would help me figure out whats happening?

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
skipcube
New User
Posts: 6
Joined: Wed Nov 23, 2011 7:12 am

Re: Trackball Scrolling

Post by skipcube »

Ah! Yes. Its working if I hold the button down and simultaneously scroll with the ball. I misunderstood the action "Change movement to Scroll". This is very cool!

Thanks.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

I did wonder if I should make a "sticky" change movement to scroll where you press it once to enable it and press it again to disable it, but the effort involved in that would have meant postponing it till v2.4.

Its is something I can still consider adding if people think it might be useful - I guess it could be preferential to having to hold a button whilst manipulating the trackball as well :) Let me know what your thoughts are.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
skipcube
New User
Posts: 6
Joined: Wed Nov 23, 2011 7:12 am

Re: Trackball Scrolling

Post by skipcube »

phil wrote:I did wonder if I should make a "sticky" change movement to scroll where you press it once to enable it and press it again to disable it, but the effort involved in that would have meant postponing it till v2.4.
I thought about requesting that. But the same effect was achieved by re configuring the mouse to "Sticky Middle Button". Then I use the trackball to scroll away.

The important thing I discovered was I had to set "Reset sticky buttons when any other button is pressed" in the advanced settings. Without this setting, the behavior is erratic (really behaves as Middle Button + other button is pressed).

Its is something I can still consider adding if people think it might be useful - I guess it could be preferential to having to hold a button whilst manipulating the trackball as well :) Let me know what your thoughts are.

Thanks,
Phil
I think some people, would like to do short scrolls while holding a button. But some , like me, need to scroll long pages. I think it may be convenient to add a "Enter sticky scroll mode, but exit if any other button is pressed" - just to avoid people trying to figure out Advanced Settings.
Pukat
New User
Posts: 7
Joined: Wed Nov 09, 2011 2:02 am

Re: Trackball Scrolling

Post by Pukat »

Hello Phil, hello everybody.

Say, I'm sorry because I was out of line for a long time, here in México the Internet service is the worst. I Apologize for that.
Ok, now:
I've tried the 2.3.9 version, works fine for me, and holding down one button in order to change movement to scroll works fine in Win7x64.

In other side, answering to Phil about the Dll hook: here is how I do:
Dll programmed in Delphi Rad Studio 2009, has 2 calls from outer program to controll it (Pascal code)

@HookOn :=GetProcAddress(HandleDLL, 'HookOn');
@HookOff:=GetProcAddress(HandleDLL, 'HookOff');

Note that previous definitions are nedeed
and in my program only do the call ---- HookOn; ----- (pascal code in Delphi) when p.e. at start on or by press one button; and call ---- HookOff; ----- (pascal code in Delphi) when p.e. the aplication is closed or by press other button or release it instead.

So the dll can do the followed things:
Do the Y axis invert alone (needs to be hooked on and hooked off).
Inform the state of one memory file that contents the state of the mouse movement (X,Y) before the system process it, in order to change it if needed (Declaration of the procedure within it needed).

So the code in pascal (program side) is as follows.

---------------------------------------------------------
unit CallDLL;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, EnterBtn;

const
NombreDLL = 'InvY.dll'; //Name of the DLL file
type
THookMouse = procedure; stdcall; //Needed to assign the hook (every language has its own)
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
HandleDLL : THandle; //A handle to assig DLL file
HookOn,
HookOff : THookMouse; //Type variables to assign the on-off procedures that activate the hook
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
{Begining of the application at Main window creation, could be into a button event instead}
procedure TForm1.FormCreate(Sender: TObject);
begin
{Assignation of the library}
HandleDLL:=LoadLibrary( PChar(ExtractFilePath(Application.Exename)+NombreDLL ) );
{if something goes wrong generates an exception}
if HandleDLL = 0 then raise Exception.Create('No se pudo cargar la DLL');
{Assignation of the on-off procedures}
@HookOn :=GetProcAddress(HandleDLL, 'HookOn');
@HookOff:=GetProcAddress(HandleDLL, 'HookOff');
{if something goes wrong generates an exception}
IF not assigned(HookOn) or not assigned(HookOff) then
raise Exception.Create('No se encontraron las funciones en la DLL'+#13+
'Cannot find the required DLL functions');
{Activating the hook}
HookOn;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
{Deactivating and Uninstalling the Hook}
if Assigned(HookOff) then HookOff;
{Free the DLL}
if HandleDLL<>0 then
FreeLibrary(HandleDLL);
end;

end.
---------------------------------------------------

So As you can see, I let the DLL does its bussiness and I only activate or deactivate the hook.
But It can be reprogrammed to take control of the process and then the DLL only reports the messages and its values in order to change them.

The only thing I having problems is something in the algorithm to reach the borders of the screen, when the mouse reach pixel Y=0 or Y=MAX I can't make it return, so I decided to cut the first and the last pixel of the height if the screen resolution in order to not reach the borders. Oh that is really embarrassing but someday I'll figure it out.

So if you are interested let me know.
I can provide the DLL code and/or the Application (Exe files)
Can you tell us, in which language did you programmed XMBC?
Thanks again.
User avatar
phil
Site Admin
Posts: 7664
Joined: Sun Apr 06, 2003 11:12 pm

Re: Trackball Scrolling

Post by phil »

Hi Pukat,

XMBC is programmed in C++ (Win32 for the hook DLL and MFC for the GUI). I think Delphi would be easier for the GUI but I haven't programmed in Pascal for 14 years or so (I used to use it all the time before I got into C++ but that was in DOS using TurboPascal - Delphi was not around then or was only just available).

The hook looks pretty similar to XMBC although as you can imaging XMBC is rather more complex due to all the things it looks for and redirects :)

Glad to hear 2.3.9 beta works - I have since released 2.3 final but its effectively exactly the same code. One day I will get round to fixing my stupid (backwards) numbering scheme too so the beta versions are not greater than the release version!

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply