StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
breakcore  
#1 Posted : Sunday, February 10, 2019 9:46:15 PM(UTC)
breakcore

Rank: Member

Reputation:

Groups: Translators, Approved
Joined: 2/10/2019(UTC)
Posts: 4
Russian Federation
Location: Moscow

Thanks: 1 times
Let me dump here some of my ideas BigGrin

Sorry for my English!

I had this flying around in my head since a long time ago. this feature might be called "smart gestures". I might mentioned something like that on the old site.
It's a little hard to describe.

Anyway, as an example, here is a script I've attached to a {MIDDLEBUTTON+WHEEL-UP/WHEEL-DOWN}, It increases/decreases the window size to defined extend:
Code:

//10% size increase (or -0.1 for decreasing)
window_scale(0.1);
function windos_scale(ws_ratio){
	wn=sp.LastActiveWindow();
	pos=wn.Position; 
	wn_wh=wn.Rectangle.Height;
	wn_ww=wn.Rectangle.Width;
	
	pos.Top = pos.Top - Math.round(wn_wh * ws_ratio);
	pos.Bottom = pos.Bottom + Math.round(wn_wh * ws_ratio);
	pos.Left = pos.Left - Math.round(wn_ww * ws_ratio);
	pos.Right = pos.Right + Math.round(wn_ww * ws_ratio);
	
	wn.Position = pos;
	wn.Activate(); 
}

This works well for me, but i'm sure such actions can be triggered in a more nicer way

Let's assume that we have checked some check box in the gesture settings, let's call it "smart gesture", and the chosen gesture curve is {right-down}.
We draw that {right-down} gesture with the right button over the window we want to change size of. That "smart gesture" option enables the gesture to be triggered before modifier button is released. So at the stage when "right-down" gesture is drawn the script executes and listens to further mouse movement, as long as modifier button is not released (the gesture now has a completely different purpose, the program doesn't try to compare what is drawn to the set of it's saved gestures)
Finally, at some part of the script we can specify that, for example, every 10px change of mouse X position (positive or negative) should trigger some function/hotkey or make some direct linking of some stuff to mouse coords (like "window.width += mouse.x"). For incremental adjustment actions, like changing the size/width/height of windows, volume adjustments, some imaging stuff like brightness/contrast stuff in photoshop etc this seems to me really handy.
As an option for solid behavior, that "smart gesture" can be used on two-button gestures, so in this case suppose you draw {right-down} gesture with left+right mouse keys and "smart gesture" could be set to activate only after releasing a left key while right key is still pressed.

Another potential application of such gestures might be a dynamic menu system, like when at "smart gesture" stage, the mouse position unfolds menu groups (like "send to" options, "convert format" options, size options etc) and at the release the hovered option is executed. That dynamic menu is an idea too BigGrin

I'm not sure that this features can be implemented, even theoretically, this is just some of my vague wishes.
Rob  
#2 Posted : Sunday, February 10, 2019 10:21:22 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,357
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 418 time(s) in 356 post(s)
That's kind of how the floaters work, like if you make one that's not Key Mode, you tap (or click left mouse) and drag, the script executes each time the pixel distance is reached.

I made those specifically for someone who wanted to do those things in Photoshop, added several things for that guy, lol.

So I get what you mean, just doesn't work in normal gesture mode.

I'll keep it in my mind and see if I can come up with some way for that to work, without breaking something else!

Edited by user Sunday, February 10, 2019 10:22:09 PM(UTC)  | Reason: Not specified

breakcore  
#3 Posted : Sunday, February 10, 2019 10:54:34 PM(UTC)
breakcore

Rank: Member

Reputation:

Groups: Translators, Approved
Joined: 2/10/2019(UTC)
Posts: 4
Russian Federation
Location: Moscow

Thanks: 1 times
Originally Posted by: Rob Go to Quoted Post
That's kind of how the floaters work, like if you make one that's not Key Mode, you tap (or click left mouse) and drag, the script executes each time the pixel distance is reached.

I made those specifically for someone who wanted to do those things in Photoshop, added several things for that guy, lol.

So I get what you mean, just doesn't work in normal gesture mode.

I'll keep it in my mind and see if I can come up with some way for that to work, without breaking something else!


Cool!

I think I need to check floaters deeply, because I initially thought they are meant only for guys with touch screen BigGrin
Rob  
#4 Posted : Monday, February 11, 2019 12:18:22 AM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,357
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 418 time(s) in 356 post(s)
Yeah, so he wanted to be able to execute an action, like from one of the main floaters like S+/Control/Alt/Shift (change brushes or something) and be able to repeat the last one, and the one before that, which makes sense in Photoshop.

That's why sp.ExecutePrevious(0); exists, there are 5 previous scripts stored 0-4, 0 is the most recent, 4 would be the action from 5 executions ago.

So he wanted a separate floater with some fixed scripts for Up and Down (draw up/down, not Press/Release), then drawing right would repeat the previous action [sp.ExecutePrevious(0);], drawing left would repeat the second oldest previous action [sp.ExecutePrevious(1);].

Hopefully this makes sense, it was pretty complicated at the time!

But, these are floaters that stay on the screen (when floaters are shown), and not something triggered by a gesture...which is a bit more complicated, as S+.net would need to be more aware of certain situations and not keep trying to recognize a longer gesture that you simply haven't yet finished, etc.

I don't yet know how feasible it will be, but I will definitely think about it here and there to see what I can come up with.
breakcore  
#5 Posted : Monday, February 11, 2019 4:45:50 AM(UTC)
breakcore

Rank: Member

Reputation:

Groups: Translators, Approved
Joined: 2/10/2019(UTC)
Posts: 4
Russian Federation
Location: Moscow

Thanks: 1 times
I completely forgot that I have done something similar in old program!
I didn't liked it back then, because it just haven't felt solid.

Here what I came up with using an old method:
(My previous function from the first post is used here too)

Code:
window_size_change_slider(1,120);
//the first parameter is 1% scaling step here, the second is the width of a slider (used for script termination, when the cursor leaves the slider area)
function window_size_change_slider(ws_ratio,slider_width){
	scale_val=100;
	var init_pt = sp.GetCurrentMousePoint();
	var info = new DisplayTextInfo();
	
	info.Message = scale_val+"%";
	info.Duration =100;
	info.Location = (init_pt.X-30)+','+(init_pt.Y+20); 
	info.MessageFont = new Font("Segoe UI Semibold", 24);
	info.BackColor = "black";
	info.Padding = 0;
	info.UsePrimaryScreen = true; 
	info.ClipToWorkingArea = false;
	sp.DisplayText(info);
	
	new_pt=sp.GetCurrentMousePoint();
	while (init_pt.Y < sp.GetCurrentMousePoint().Y+(slider_width/2) && init_pt.Y > sp.GetCurrentMousePoint().Y-(slider_width/2)) {
		curr_pt = sp.GetCurrentMousePoint();
		delta_x=ws_ratio*Math.round((init_pt.X-curr_pt.X)/10)
		curr_delta_x=ws_ratio*Math.round((new_pt.X-curr_pt.X)/10)
		curr_scale_val=Number(100-curr_delta_x);
		info.Message = "zoom: "+Number(100-delta_x)+"%";
		info.Location = (curr_pt.X-30)+','+(curr_pt.Y+20); 
		if (curr_scale_val!=scale_val) {
			window_size_change(0.01*ws_ratio*curr_delta_x) //sending calculated values to the function that scales the window 
			scale_val=curr_scale_val;
			new_pt=sp.GetCurrentMousePoint();
		}
		sp.DisplayTextUpdate(info);
		sp.Sleep(30); 
	}
}


This might not optimized well yet, but works nicely)

I think this virtual sliders is great for incremental adjustments.
Also it might be great to have a feature for such sliders to be somewhat drawn semi-transparently on the screen Drool

Edited by user Monday, February 11, 2019 4:47:32 AM(UTC)  | Reason: Not specified

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.