About Monkey 2 › Forums › Monkey 2 Development › Mojox textview, selecting with shift behaviour
This topic contains 2 replies, has 2 voices, and was last updated by
cocon 2 years, 2 months ago.
-
AuthorPosts
-
February 3, 2017 at 2:12 am #6935
Holding Shift and clicking in order to select text, seems to work only the key repeat events.
You can see the behaviour here:
https://1drv.ms/v/s!AquVr9J7xRcsgXjK6aEadQLY1AHJFebruary 3, 2017 at 2:53 am #6936I think we get double click logic here.
Try to click slower.
February 4, 2017 at 1:29 am #6942Yes, the reason is that the boolean condition that would allow the fix happen, is valid only for repeat events. Specifically is the way that modifier keys are processed.
Monkey12345678910textview.monkey2 - line 1201Method OnContentMouseEvent( event:MouseEvent ) OverrideSelect event.TypeCase EventType.MouseDownSelect event.ClicksCase 1_cursor=CharAtPoint( event.Location )' This one...If Not (event.Modifiers & Modifier.Shift) _anchor=_cursorAfter examining these *.monkey2 files in order to understand the inner workings: view, window, app, textview. The best fix for this problem, is this one.
Monkey123456789' Previous Implementation' If Not (event.Modifiers & Modifier.Shift) _anchor=_cursor' New OneIf Keyboard.KeyDown(Key.LeftShift) Or Keyboard.KeyDown(Key.RightShift)' nothingElse_anchor=_cursorEndUnfortunately I have to bypass the event mechanism and do a dirty hack (ignore the event checks) and rely on the Keyboard class. I am not proud of the solution, but it will work for now, until I find something else better better.
P.S. Some notes on this subject _________________________________________________
Regarding the proper “textview solution” would be fixed like this: app.monkey2 line 720
Monkey12345If kevent->repeat_SendKeyEvent( EventType.KeyRepeat )ElseSendKeyEvent( EventType.KeyDown )EndifEither by creating a new important event KeyPress (which captures both states of Down and Repeat) or the significance of Key.Repeat would be changed (changing it’s bitwise value) if it makes any sense to do so:
Monkey1If kevent->repeat_ SendKeyEvent( EventType.Down & EventType.KeyRepeat )I don’t know if these proposals are good or not but I though it a good opportunity to throw the ideas, and see what happens.
-
AuthorPosts
You must be logged in to reply to this topic.