CTRL + left click jump

SyntaxEditor for WPF Forum

Posted 2 years ago by SPF - Appeon
Version: 22.1.1
Avatar

I want to realize the effect of click jump in your space. Is there any better scheme?

See the picture for the specific effect.

https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=vscode%20%E5%8D%95%E5%87%BB%E8%B7%B3%E8%BD%AC&step_word=&hs=0&pn=0&spn=0&di=7060663421280190465&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&istype=0&ie=utf-8&oe=utf-8&in=&cl=2&lm=6&st=undefined&cs=3175255155%2C3637288707&os=320840758%2C2875389369&simid=3175255155%2C3637288707&adpicid=0&lpn=0&ln=1587&fr=&fmq=1647588078338_R&fm=&ic=undefined&s=undefined&hd=0&latest=0&copyright=0&se=&sme=&tab=0&width=undefined&height=undefined&face=undefined&ist=&jit=&cg=&bdtype=0&oriquery=&objurl=https%3A%2F%2Fgimg2.baidu.com%2Fimage_search%2Fsrc%3Dhttp%3A%2F%2Fimg-blog.csdnimg.cn%2F20210223114951290.gif%26refer%3Dhttp%3A%2F%2Fimg-blog.csdnimg.cn%26app%3D2002%26size%3Df9999%2C10000%26q%3Da80%26n%3D0%26g%3D0n%26fmt%3Dauto%3Fsec%3D1650180090%26t%3D26cd4051442080bd65e15fb044a429e9&fromurl=ippr_z2C%24qAzdH3FAzdH3Fks52_z%26e3Bvf1g_z%26e3BgjpAzdH3Fojtxtg_9cb99a9lAzdH3Fw6ptvsjAzdH3F1jpwtsfAzdH3F88nl0cb8d&gsm=1&rpstart=0&rpnum=0&islist=&querylist=&nojc=undefined&dyTabStr=MCw0LDEsNiw1LDMsNyw4LDIsOQ%3D%3D

Comments (3)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you implement an IEditorViewPointerInputEventSink language service and register the service on your syntax language, you can do something like this in its NotifyPointerPressed callback to achieve Ctrl+Click for links:

void IEditorViewPointerInputEventSink.NotifyPointerPressed(IEditorView view, InputPointerButtonEventArgs e) {
	if ((e.ButtonKind == InputPointerButtonKind.Primary) && (Keyboard.Modifiers == ModifierKeys.Control)) {
		System.Diagnostics.Process.Start("https://www.actiprosoftware.com");
		e.Handled = true;
	}
}


Actipro Software Support

Posted 2 years ago by SPF - Appeon
Avatar

I want to get the "range", "position" and other information of the clicked word while "Ctrl + click". Is there any way to get it?

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Details about the click position can be obtained from hit testing. Take a look at the Hit Testing QuickStart in our Sample Browser for a demonstration. The following topic in our documentation also covers how to perform hit testing:

https://www.actiprosoftware.com/docs/controls/wpf/syntaxeditor/user-interface/editor-view/hit-testing

The InputPointerButtonEventArgs from the previous sample code contain the data you need to determine the mouse location to be used for the hit test.


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.