English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 April 2023, 18:53   #1
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Change Mouse pointer on the fly within Workbench?

As the title says - does anyone know how to change the mouse pointer image at will whilst in workbench. I have managed it through a window but as soon as you click outside the window it reverts to the Workbench default.

Cheers for any help/suggestions.
Havie is offline  
Old 01 May 2023, 04:01   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Have you tried using a borderless, backdrop window? The pointer shape is in the window structure, as you noticed.
Samurai_Crow is offline  
Old 01 May 2023, 07:27   #3
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Why wanting to change mouse pointer of other apps ? This looks... impolite, to me.
meynaf is offline  
Old 02 May 2023, 08:28   #4
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by meynaf View Post
Why wanting to change mouse pointer of other apps ? This looks... impolite, to me.
Not at all! Don't want to change the pointer to something else but just make an app to make pointet easier to locate on a hires screen. We are gettibg older, eyes are getting worse and screen resolutions are going up!
Havie is offline  
Old 02 May 2023, 08:31   #5
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Havie View Post
Not at all! Don't want to change the pointer to something else but just make an app to make pointet easier to locate on a hires screen. We are gettibg older, eyes are getting worse and screen resolutions are going up!
Then why not using regular pointer prefs ?
meynaf is offline  
Old 02 May 2023, 09:34   #6
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,233
Quote:
Originally Posted by Havie View Post
Not at all! Don't want to change the pointer to something else but just make an app to make pointet easier to locate on a hires screen. We are gettibg older, eyes are getting worse and screen resolutions are going up!

The pointer within your own program window is all yours, and you can change it as you like - but probably should not, unless there is quite a good reason. So what is the reason? A possible reason is to set the "wait" cursor to indicate that the program is busy, but even that is up to the user to draw, and you can request this pointer from intuition.


Then, there is the default pointer used .... by default. The default pointer is all the user's choice to make. Why do you think that you as a program author are better at making a choice for the user how the default pointer should look like than the user himself?
Thomas Richter is offline  
Old 02 May 2023, 09:59   #7
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,918
If I understand correctly the idea is to have something like a commodity that will make the pointer larger, e.g. when a certain key is pressed. Like the ctrl key in Windows can be set to create a circle around the mouse pointer to make spotting the mouse pointer easier. Such things can indeed be useful imho.
grond is offline  
Old 02 May 2023, 17:40   #8
No.3
Registered User
 
Join Date: Sep 2022
Location: Switzerland
Posts: 115
Quote:
Originally Posted by grond View Post
Such things can indeed be useful imho.
Well, it's the most useless feature in windows, they would better provide a well visible mouse pointer...
Therefore one of my first steps when installing Windows is: "install" the AmigaOS 3 mousepointer...
No.3 is offline  
Old 02 May 2023, 18:59   #9
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by No.3 View Post
Well, it's the most useless feature in windows, they would better provide a well visible mouse pointer...
Therefore one of my first steps when installing Windows is: "install" the AmigaOS 3 mousepointer...
Absolutelh right and my app is aimed at the useless category in the Tool Jam. Have no intention of hijacking someone else's pointer
other than making it double size for a second when they mouse ia shaken to make it easy to locate.

Last edited by Havie; 02 May 2023 at 19:08.
Havie is offline  
Old 02 May 2023, 19:02   #10
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by Thomas Richter View Post
The pointer within your own program window is all yours, and you can change it as you like - but probably should not, unless there is quite a good reason. So what is the reason? A possible reason is to set the "wait" cursor to indicate that the program is busy, but even that is up to the user to draw, and you can request this pointer from intuition.


Then, there is the default pointer used .... by default. The default pointer is all the user's choice to make. Why do you think that you as a program author are better at making a choice for the user how the default pointer should look like than the user himself?
Gosh - what a controversy! But as you can see, I have no intention of changing the pointer other than doubling it in size briefly to help locate it.

My question still stands - can it be done and if so how?
Havie is offline  
Old 02 May 2023, 20:37   #11
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,348
Quote:
Originally Posted by No.3 View Post
Well, it's the most useless feature in windows, they would better provide a well visible mouse pointer...
Therefore one of my first steps when installing Windows is: "install" the AmigaOS 3 mousepointer...
Every feature is useless until it becomes useful. There's a reason both Windows and macOS include variations on this idea, and it's something I've used myself on rare occasions.
Daedalus is online now  
Old 02 May 2023, 21:56   #12
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
Quote:
Originally Posted by Havie View Post
My question still stands - can it be done and if so how?
Nice idea! There's no clean way to do this, but there's probably a dirty way!

I think I'd probably try finding the currently active window, and calling SetPointer() on it - but be aware that since you don't own that window, it'll be an evil hack.

While multitasking is enabled a window can vanish at any moment, so you'll need to take that into account. (Forbid()/Permit() around the manipulation is the obvious method - I'd be surprised if that interacted badly with SetPointer() but there are no guarantees. RTG systems in particular might be a problem. LockIBase()/UnlockIBase() might also work, but the documentation explicitly says you're not allowed to call Intuition or system functions with a lock held, so even if that works, it's in evil hack territory.)

Assuming you re-enable multitasking briefly before disabling it again and removing your custom cursor, you'll need to make very sure that (a) the window still exists (even if it does, it may or may not still be the active window), (b) the application that owns the window hasn't changed the cursor to something else in the meantime, and (c) you restore whatever the cursor was before you messed with it. (Caching the relevant fields from the Window structure will probably work on ECS/AGA systems - though again, no guarantees - on RTG systems I've no idea what will happen.)

Have fun!
robinsonb5 is offline  
Old 03 May 2023, 10:25   #13
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Havie View Post
My question still stands - can it be done and if so how?

Since the pointer image usually is the full size of the sprite, and you cannot double sprite size (like on C64), this may require temporarily using 2 side by side double-height sprites. Maybe you could use e.g. sprite 1 and 2 with suitable imagery, meanwhile hiding or moving the original mouse pointer off screen or something to that effect.

Last edited by hooverphonique; 03 May 2023 at 15:08.
hooverphonique is offline  
Old 03 May 2023, 21:38   #14
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by robinsonb5 View Post
Nice idea! There's no clean way to do this, but there's probably a dirty way!

I think I'd probably try finding the currently active window, and calling SetPointer() on it - but be aware that since you don't own that window, it'll be an evil hack.

While multitasking is enabled a window can vanish at any moment, so you'll need to take that into account. (Forbid()/Permit() around the manipulation is the obvious method - I'd be surprised if that interacted badly with SetPointer() but there are no guarantees. RTG systems in particular might be a problem. LockIBase()/UnlockIBase() might also work, but the documentation explicitly says you're not allowed to call Intuition or system functions with a lock held, so even if that works, it's in evil hack territory.)

Assuming you re-enable multitasking briefly before disabling it again and removing your custom cursor, you'll need to make very sure that (a) the window still exists (even if it does, it may or may not still be the active window), (b) the application that owns the window hasn't changed the cursor to something else in the meantime, and (c) you restore whatever the cursor was before you messed with it. (Caching the relevant fields from the Window structure will probably work on ECS/AGA systems - though again, no guarantees - on RTG systems I've no idea what will happen.)

Have fun!
Thanks this is helpful. Not quite sure how to do all this yet!

How would I enable/disable multitasking as this is probably the most important thing I need to understand?
Havie is offline  
Old 03 May 2023, 21:41   #15
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by hooverphonique View Post
Since the pointer image usually is the full size of the sprite, and you cannot double sprite size (like on C64), this may require temporarily using 2 side by side double-height sprites. Maybe you could use e.g. sprite 1 and 2 with suitable imagery, meanwhile hiding or moving the original mouse pointer off screen or something to that effect.
Actually, the Workbench pointer doesn't take up a full sprite area as in my test code I made it double in size easily but wouldn't necessarily be true of custom pointers.

Mind you, I am aiming at the useless category and if I get too involved, it won't be any more!

You are right, I could potential copy the current pointer and double the width of the pixels or even double width and height (but would need 4 sprites at this point).

Never written anything other than games and nothing Workbench friendly before so this is all a new adventure.

Thanks for your helpful suggestion.
Havie is offline  
Old 03 May 2023, 22:53   #16
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
So I can constantly switch between open window and my mouse pointer code window which gives a lovely flickering effect! Anyone know how to multitask between windows without selecting each window in turn i.e. multitask between windows behind the scenes so to speak? I had assumed that Amiga OS would automatically multitask between open windows but alas no.
Havie is offline  
Old 04 May 2023, 00:09   #17
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Havie View Post
You are right, I could potential copy the current pointer and double the width of the pixels or even double width and height (but would need 4 sprites at this point).
No, amiga sprites can be very tall (up to 512px IIRC), so you only need 2.


Quote:
Originally Posted by Havie View Post
Thanks for your helpful suggestion.
That's why we're here, ain't it!?
hooverphonique is offline  
Old 04 May 2023, 08:00   #18
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
Quote:
Originally Posted by hooverphonique View Post
No, amiga sprites can be very ta]ll (up to 512px IIRC), so you only need 2.
Doh - I knew that.

And thanks qgain for the helpful and positive reply.
Havie is offline  
Old 04 May 2023, 08:03   #19
Havie
Registered User
 
Havie's Avatar
 
Join Date: Mar 2012
Location: UK
Posts: 1,895
I am usimg Blitz Basic which I don't think mutlittasks out of the box so assume I would need to use EXEC calls? But haven't a clue.

Something that seems simple now seems rather difficult...
Havie is offline  
Old 04 May 2023, 13:52   #20
S0ulA55a551n
Registered User
 
S0ulA55a551n's Avatar
 
Join Date: Nov 2010
Location: South Wales
Age: 47
Posts: 937
A little off topic, but back in the day the "useless" stuff was some of my fav.

Like the hack that gave you the MTV logo in corner of screen. Or lemmings in your task bar.

Go for it
S0ulA55a551n is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter mask on the fly change weird behavior mcbpete support.WinUAE 2 04 September 2018 20:47
Mid-line bitplane pointer change? NorthWay Coders. Asm / Hardware 10 26 September 2015 13:45
Mouse Pointer Washac support.WinUAE 2 19 February 2012 20:57
How to change Mouse Pointer in AmigaSYS4 fitzsteve support.Apps 8 26 August 2010 16:21
Mouse pointer Washac support.Other 4 12 February 2010 01:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.14371 seconds with 15 queries