ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Photoshop hand tool
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
497 Posts

Posted - Feb 11 2019 :  12:47:40  Show Profile  Reply
How and where would you code to create the photoshop behavior that if you hold the space bar, you are able to use the miscroll mouse interact ?

Thanks

xequte

38127 Posts

Posted - Feb 11 2019 :  19:14:01  Show Profile  Reply
Hi

There is no built-in functionality for that, but you might be able to achieve it using the KeyDown and KeyUp events.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 12 2019 :  08:37:07  Show Profile  Reply
Yes, that is what I meant. just wanted to know what to write in the keydown event.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 12 2019 :  10:14:32  Show Profile  Reply
Right now, i have that in the onkeydown event
if HiWord(GetKeyState(vk_space)) <> 0 then
imageenview.MouseInteract := [miScroll]

that works but when i release the space bar, i would like to have the previous mouseinteract back. is taht possible ?
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 12 2019 :  11:02:17  Show Profile  Reply
Try this:
public
    { Public declarations }
    AMouseInteract: TIEMouseInteract;

procedure TForm1.ImageEnView1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  AMouseInteract := ImageEnView1.MouseInteract;
  if HiWord(GetKeyState(vk_space)) <> 0 then
    ImageEnView1.MouseInteract := [miScroll]
  else
    ImageEnView1.MouseInteract := AMouseInteract;
end;
Define AMouseInteract as a public var and set AMouseInteract to the ImageEnView1.MouseInteract in the methods where you set the mouseinteract:
procedure TForm1.SelectRect1Click(Sender: TObject);
begin
  ImageEnView1.MouseInteract := [miSelect];
  AMouseInteract := ImageEnView1.MouseInteract;
end;

procedure TForm1.SelectEllipse1Click(Sender: TObject);
begin
  ImageEnView1.MouseInteract := [miSelectCircle];
  AMouseInteract := ImageEnView1.MouseInteract;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 12 2019 :  11:41:27  Show Profile  Reply
Thanks Bill. When i release the space bar, the miscroll is still selected as i can move the image around although i had the miselectcircle selected previously. I setup the code like you did. Maybe something should be in the onkeyup event ?
Thanks
Go to Top of Page

TonyAntonio

USA
4 Posts

Posted - Feb 13 2019 :  12:08:08  Show Profile  Reply
Thanks for the tip, fellas! I didn't know that there was more than one way to accomplish this.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 13 2019 :  12:10:28  Show Profile  Reply
Are you using a better way ? It is not working for me. when i release the space bat, the miscroll is still selected.
Go to Top of Page

xequte

38127 Posts

Posted - Feb 14 2019 :  02:48:26  Show Profile  Reply
Hi

Looks like in KeyUp you should add:

ImageEnView1.MouseInteract := AMouseInteract;

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 15 2019 :  09:28:25  Show Profile  Reply
Nope, still keep the miscroll, does not revert to miselect if that was the last command selected.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 15 2019 :  09:52:11  Show Profile  Reply
I think the issue is that the amouseintecat does not keep the last tool. let me look into that.
Go to Top of Page

pierrotsc

USA
497 Posts

Posted - Feb 15 2019 :  09:54:38  Show Profile  Reply
Got it to work now...Thanks for all the adice. awesome forum.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: