English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 08 February 2023, 00:48   #1
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,613
Prevent user from moving my Screen

I open it with a new screen struct, but I haven't seen any pertinent flags.

I can think of a few creative alternatives:
  1. Protect the Screen from mouse events by "unfocusing" it (while still being shown and frontmost)
  2. Actually somehow hide it from the Screen list (while still being active and frontmost)
  3. Prevent clicks on the title bar on mouse click.
  4. Prevent the mouse from moving the pointer. Forbid() does, but eventually control is handed back.
  5. Move the pointer back as much as it has moved since last time.
  6. Move the Screen back as much as it has moved since last time.

I realize they all read like an excellent prank application but it's for a utility.
Photon is offline  
Old 08 February 2023, 06:25   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,236
There is none. You can place a window on top of the drag bar, but you can still drag the screen then with the right Amiga key and the left mouse button.
Thomas Richter is offline  
Old 08 February 2023, 10:15   #3
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,613
Maximized window could work. For my purposes, only left-click+drag needs be stopped. I'd have to clear it immediately to draw my stuff, and not waste memory.

Speaking of moving the pointer, can I do so programmatically? If not, then can I send keyboard events to move the pointer?

Just thought of another prank, SetPointer() with an offset hotspot. Won't help much, maybe a little.
Photon is offline  
Old 08 February 2023, 10:42   #4
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 363
You could set up an input handler (with input.device) with a very high priority, then intercept all events and remove the ones that are related to dragging your specific screen
koobo is offline  
Old 08 February 2023, 11:32   #5
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Photon View Post
Speaking of moving the pointer, can I do so programmatically? If not, then can I send keyboard events to move the pointer?

Yes, using input.device, you can inject pointer move events.
hooverphonique is offline  
Old 08 February 2023, 18:53   #6
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,613
Thx guys, will experiment.

Probably the best option would be to cancel mouse movement. The clicks themselves would then do nothing. Maybe save and restore mouse X/Y counters before/after Forbid/Permit.
Photon is offline  
Old 08 February 2023, 19:12   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,343
On Kickstart 3.0+ you could use the SA_Draggable and SA_Exclusive tags?
mark_k is online now  
Old 08 February 2023, 19:14   #8
No.3
Registered User
 
Join Date: Sep 2022
Location: Switzerland
Posts: 115
Quote:
Originally Posted by Photon View Post
...it's for a utility.
for what OS version? As with OS 3+

Code:
	SA_Draggable:  ti_Data is a boolean.  Set to FALSE if you
	    wish your screen to be non-draggable.  This tag should be
	    used very sparingly!.  Defaults to TRUE.  For child screens
	    (see SA_Parent, SA_FrontChild, and SA_BackChild) this tag
	    has a slightly different meaning:  non-draggable child
	    screens are non-draggable with respect to their parent,
	    meaning they always drag exactly with the parent, as
	    opposed to having relative freedom.  Also see
	    ScreenPosition().  (V39)
No.3 is offline  
Old 08 February 2023, 20:28   #9
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,613
I support KS1.2-3.1+ with the utility. If something is impossible or difficult I will make exceptions for all but 1.3 and 3.1. So then my goal wouldn't be achieved on 1.3. But great that they added it.
Photon is offline  
Old 08 February 2023, 20:44   #10
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,236
SA_Draggable is probaby what you want, or maybe not quite what you want. The problem is that it also stops autoscroll screens from scrolling (if I recall correctly). If autoscroll is not an option for you, then go for it.
Thomas Richter is offline  
Old 08 February 2023, 20:46   #11
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,236
Quote:
Originally Posted by koobo View Post
You could set up an input handler (with input.device) with a very high priority, then intercept all events and remove the ones that are related to dragging your specific screen
Note that there are roughly two positions where an input handler could sit: Upfront the intuition handler, and below the intuition input handler. Above the intuition input handler, all a custom input handler sees are raw mouse moves bare any position information with only relative movements, and bare any scaling to screen coordinates. Below the intuition input handler, you do receive coordinates, but it is too late there to intercept intuition.
Thomas Richter 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
Prevent input from reaching CLI/WB paraj Coders. System 2 06 February 2022 18:39
how to prevent windows audio cd playpack during emulation? honx support.WinUAE 24 11 December 2018 10:48
How to prevent 100% CPU usage ? mahen support.FS-UAE 3 01 November 2017 20:19
will a NTSC A520 prevent me... NfernalNfluence support.Hardware 0 08 September 2007 12:07
It's moving..it's alive, it's moving.. IT'S ALLIIIIIIIIIIVE!!!!!!!!!1 alkis21 Retrogaming General Discussion 23 22 August 2002 10:51

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 20:27.

Top

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