blink icon indicating copy to clipboard operation
blink copied to clipboard

Does not support cursor movements from the ios keyboard

Open pfgithub opened this issue 9 years ago • 10 comments

The arrows above the keyboard work fine, however force touch dragging on the default keyboard usually moves the cursor in standard text fields and it does not on blink

pfgithub avatar Nov 28 '17 19:11 pfgithub

This is a good idea, will see what we can do.

carloscabanero avatar Dec 18 '17 20:12 carloscabanero

Is this complicated to implement? I could attempt to do it. This is only intuitive if you heard about it, maybe the devs have not heard of two finger dragging a soft keyboard for arrow keys. It would help because it is much more difficult to repeat press soft keys whether it’s arrow keys or hjkl for moving the cursor.

robotjosh avatar Apr 10 '18 07:04 robotjosh

@robotjosh it is a little bit tricky to implement. But if you want to try, please do.

There are few things might be useful for you:

  • TextView is hidden and collapsed. So when you got - (void)beginFloatingCursorAtPoint:(CGPoint)point You need reposition it. So cursor can float all the screen.

  • There are 4 modes of mouse reporting. (you may be interested in MOUSE_REPORT_DISABLED and MOUSE_REPORT_PRESS). If it is disabled you need transform cursor movements to arrow keys. (blink prompts for instance) If it is MOUSE_REPORT_PRESS you need to transform cursor movements to mousedown and mouseup events.

yury avatar Apr 10 '18 08:04 yury

I thought it would be simply attaching the movement event to the arrow key actions. I'll look into this more, I really want to be able to scroll easier!

robotjosh avatar Apr 11 '18 17:04 robotjosh

I added this and it does the printf but I'm having trouble making sense of what it reports.

  • (void)updateFloatingCursorAtPoint:(CGPoint)point { NSLog(@"cursor update: %@", NSStringFromCGPoint(point)); }

The point reported is all over the place. Below is the printout from tapping down in the middle of the keyboard, moving my fingers 2 inches left, and the back to the origin in a continuous motion. Makes no sense or I am failing to understand how this is supposed to work.

2018-04-16 21:19:35.308128-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:35.308559-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:35.311260-0500 Blink[7476:4429535] cursor update: {0, 5.2690488117068668e-07} 2018-04-16 21:19:35.319371-0500 Blink[7476:4429535] cursor update: {0, 0.32045450591996838} 2018-04-16 21:19:35.327827-0500 Blink[7476:4429535] cursor update: {0, 0.63095358327966344} 2018-04-16 21:19:35.336401-0500 Blink[7476:4429535] cursor update: {0, 0.91220377699475441} 2018-04-16 21:19:35.344429-0500 Blink[7476:4429535] cursor update: {0, 1.2127579042116101} 2018-04-16 21:19:35.352531-0500 Blink[7476:4429535] cursor update: {0, 1.4940080979267012} 2018-04-16 21:19:35.361079-0500 Blink[7476:4429535] cursor update: {0, 1.4940083744922439} 2018-04-16 21:19:35.369189-0500 Blink[7476:4429535] cursor update: {0, 2.0602585274525298} 2018-04-16 21:19:35.377961-0500 Blink[7476:4429535] cursor update: {0, 2.3333836847342839} 2018-04-16 21:19:35.385844-0500 Blink[7476:4429535] cursor update: {0, 2.624006495120546} 2018-04-16 21:19:35.394488-0500 Blink[7476:4429535] cursor update: {0, 3.1902566480809629} 2018-04-16 21:19:35.402497-0500 Blink[7476:4429535] cursor update: {0, 3.4908107752978186} 2018-04-16 21:19:35.411273-0500 Blink[7476:4429535] cursor update: {0, 4.075735189847232} 2018-04-16 21:19:35.419700-0500 Blink[7476:4429535] cursor update: {0, 4.6606596043965016} 2018-04-16 21:19:35.428077-0500 Blink[7476:4429535] cursor update: {0, 4.9512824147828969} 2018-04-16 21:19:35.436255-0500 Blink[7476:4429535] cursor update: {0, 5.8376026726825252} 2018-04-16 21:19:35.444529-0500 Blink[7476:4429535] cursor update: {0, 6.148101750042362} 2018-04-16 21:19:35.452520-0500 Blink[7476:4429535] cursor update: {0, 6.4293519437573243} 2018-04-16 21:19:35.461326-0500 Blink[7476:4429535] cursor update: {0, 7.2881020543239394} 2018-04-16 21:19:35.469216-0500 Blink[7476:4429535] cursor update: {0, 7.8543522072842329} 2018-04-16 21:19:35.477858-0500 Blink[7476:4429535] cursor update: {0, 8.4392766218336384} 2018-04-16 21:19:35.485852-0500 Blink[7476:4429535] cursor update: {0, 9.0055267747939247} 2018-04-16 21:19:35.494488-0500 Blink[7476:4429535] cursor update: {0, 9.5717769277543407} 2018-04-16 21:19:35.503003-0500 Blink[7476:4429535] cursor update: {0, 10.156701342303609} 2018-04-16 21:19:35.510802-0500 Blink[7476:4429535] cursor update: {0, 10.761092461639883} 2018-04-16 21:19:35.519305-0500 Blink[7476:4429535] cursor update: {0, 11.647412719539512} 2018-04-16 21:19:35.528709-0500 Blink[7476:4429535] cursor update: {0, 12.481787798888195} 2018-04-16 21:19:35.537184-0500 Blink[7476:4429535] cursor update: {0, 13.125394915239598} 2018-04-16 21:19:35.545769-0500 Blink[7476:4429535] cursor update: {0, 13.406645108954688} 2018-04-16 21:19:35.553007-0500 Blink[7476:4429535] cursor update: {0, 13.972895261914974} 2018-04-16 21:19:35.561022-0500 Blink[7476:4429535] cursor update: {0, 14.249999482631711} 2018-04-16 21:19:35.569445-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.580298-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.591274-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.597371-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.605579-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.613920-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.622309-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.632929-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.638946-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.647251-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.655640-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.663935-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.674617-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.680741-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.691300-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.699640-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.707994-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.716309-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.724691-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.730584-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.741286-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.749650-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.757977-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.766283-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.772143-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.780606-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.791327-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.799670-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.805730-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.813922-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.822398-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.847194-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:35.947586-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:36.048050-0500 Blink[7476:4429535] cursor update: {0, 14} 2018-04-16 21:19:36.389813-0500 Blink[7476:4429535] cursor update: {0.25062496997415451, 13.999999970123174} 2018-04-16 21:19:36.399677-0500 Blink[7476:4429535] cursor update: {0.50124993994832323, 13.999999940246344} 2018-04-16 21:19:36.405698-0500 Blink[7476:4429535] cursor update: {1.0062498785555363, 13.999999880045653} 2018-04-16 21:19:36.424699-0500 Blink[7476:4429535] cursor update: {1.5112498171627493, 13.999999819844962} 2018-04-16 21:19:36.430677-0500 Blink[7476:4429535] cursor update: {2.8393746402114743, 13.999999661520128} 2018-04-16 21:19:36.441332-0500 Blink[7476:4429535] cursor update: {3.8793745066970615, 13.999999537542465} 2018-04-16 21:19:36.449752-0500 Blink[7476:4429535] cursor update: {5.2074993297457866, 13.99999937921763} 2018-04-16 21:19:36.455706-0500 Blink[7476:4429535] cursor update: {6.8424991026520843, 13.999999184310571} 2018-04-16 21:19:36.466337-0500 Blink[7476:4429535] cursor update: {7.8824989691376857, 13.999999060333028} 2018-04-16 21:19:36.474679-0500 Blink[7476:4429535] cursor update: {9.846873683854966, 13.999998826161288} 2018-04-16 21:19:36.483027-0500 Blink[7476:4429535] cursor update: {11.815623363480015, 13.718748632446196} 2018-04-16 21:19:36.491368-0500 Blink[7476:4429535] cursor update: {13.454373102486187, 13.445623475164442} 2018-04-16 21:19:36.497370-0500 Blink[7476:4429535] cursor update: {16.559360137636745, 13.135124397804887} 2018-04-16 21:19:36.508031-0500 Blink[7476:4429535] cursor update: {18.884340368808921, 12.844501587418488} 2018-04-16 21:19:36.516336-0500 Blink[7476:4429535] cursor update: {20.866215009765469, 12.27825143445807} 2018-04-16 21:19:36.522398-0500 Blink[7476:4429535] cursor update: {23.986018344622423, 11.654290380700704} 2018-04-16 21:19:36.533046-0500 Blink[7476:4429535] cursor update: {25.954768024247457, 11.373040186985744} 2018-04-16 21:19:36.539018-0500 Blink[7476:4429535] cursor update: {28.67452653021931, 10.768649067649608} 2018-04-16 21:19:36.549707-0500 Blink[7476:4429535] cursor update: {31.014223003034147, 10.183724653100203} 2018-04-16 21:19:36.557964-0500 Blink[7476:4429535] cursor update: {33.353919475848969, 9.5988002385509361} 2018-04-16 21:19:36.563994-0500 Blink[7476:4429535] cursor update: {36.05391905742438, 9.5987999166860014} 2018-04-16 21:19:36.572345-0500 Blink[7476:4429535] cursor update: {38.417438888156667, 8.7124796587862328} 2018-04-16 21:19:36.583064-0500 Blink[7476:4429535] cursor update: {41.522425923307225, 8.4019805814263968} 2018-04-16 21:19:36.591357-0500 Blink[7476:4429535] cursor update: {44.642229258164178, 7.7780195276691728} 2018-04-16 21:19:36.597351-0500 Blink[7476:4429535] cursor update: {48.182066000475629, 7.134412411317772} 2018-04-16 21:19:36.605755-0500 Blink[7476:4429535] cursor update: {50.901824506447483, 6.5300212919814982} 2018-04-16 21:19:36.616390-0500 Blink[7476:4429535] cursor update: {54.881686786180431, 5.8667104244107406} 2018-04-16 21:19:36.624743-0500 Blink[7476:4429535] cursor update: {58.421523528491889, 5.2231033080593399} 2018-04-16 21:19:36.633038-0500 Blink[7476:4429535] cursor update: {61.98571580582729, 4.2510504122982233} 2018-04-16 21:19:36.639083-0500 Blink[7476:4429535] cursor update: {65.510704914467283, 3.9305964332831369} 2018-04-16 21:19:36.647338-0500 Blink[7476:4429535] cursor update: {70.455198908635495, 2.8710613894661883} 2018-04-16 21:19:36.658060-0500 Blink[7476:4429535] cursor update: {74.919614375198151, 1.8408111058715448} 2018-04-16 21:19:36.664039-0500 Blink[7476:4429535] cursor update: {79.824607153132661, 1.4904538911723328} 2018-04-16 21:19:36.674688-0500 Blink[7476:4429535] cursor update: {84.289022619695331, 0.46020360757753132} 2018-04-16 21:19:36.683073-0500 Blink[7476:4429535] cursor update: {88.728904842094721, -0.22285573767087641} 2018-04-16 21:19:36.689005-0500 Blink[7476:4429535] cursor update: {93.168787064494097, -0.90591508291928413} 2018-04-16 21:19:36.697435-0500 Blink[7476:4429535] cursor update: {98.613344793227782, -1.9948273036694877} 2018-04-16 21:19:36.705719-0500 Blink[7476:4429535] cursor update: {103.53324287424476, -2.697670485138727} 2018-04-16 21:19:36.716421-0500 Blink[7476:4429535] cursor update: {107.97312509664415, -3.3807298303871347} 2018-04-16 21:19:36.724708-0500 Blink[7476:4429535] cursor update: {112.43754056320681, -4.4109801139817781} 2018-04-16 21:19:36.733082-0500 Blink[7476:4429535] cursor update: {113.9841229132997, -5.113823295451188} 2018-04-16 21:19:36.741414-0500 Blink[7476:4429535] cursor update: {110.61080718237537, -6.1440735790458305} 2018-04-16 21:19:36.749744-0500 Blink[7476:4429535] cursor update: {102.77307598488841, -6.4844580985300047} 2018-04-16 21:19:36.758079-0500 Blink[7476:4429535] cursor update: {90.510352932184759, -7.5733703192802073} 2018-04-16 21:19:36.766487-0500 Blink[7476:4429535] cursor update: {72.803072150747411, -8.6036206028748516} 2018-04-16 21:19:36.772376-0500 Blink[7476:4429535] cursor update: {50.631375902747408, -9.5410159716704612} 2018-04-16 21:19:36.783069-0500 Blink[7476:4429535] cursor update: {23.995264188184525, -9.4481610568712568} 2018-04-16 21:19:36.791449-0500 Blink[7476:4429535] cursor update: {0, -8.652462960602973} 2018-04-16 21:19:36.799753-0500 Blink[7476:4429535] cursor update: {0, -7.2131577479831392} 2018-04-16 21:19:36.808122-0500 Blink[7476:4429535] cursor update: {0, -4.4656643218377585} 2018-04-16 21:19:36.814011-0500 Blink[7476:4429535] cursor update: {0, -1.0745637793409766} 2018-04-16 21:19:36.824814-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.833168-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.841472-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.847416-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.855812-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.864180-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.874835-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.883159-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.891526-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.899852-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.905837-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.914139-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.924823-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.930801-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.939135-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.947435-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.955797-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.966538-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.972549-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.980728-0500 Blink[7476:4429535] cursor update: {0, -1.7763568394002505e-15} 2018-04-16 21:19:36.989207-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:36.999878-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.008136-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.014233-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.022528-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.033214-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.041679-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.049924-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.058365-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.064167-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.074776-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.079230-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.087378-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.114202-0500 Blink[7476:4429535] cursor update: {0, 0} 2018-04-16 21:19:37.215401-0500 Blink[7476:4429535] cursor update: {0, 0}

robotjosh avatar Apr 17 '18 02:04 robotjosh

I recommend you to make _termInput visible and set frame to (0, 0, 300, 300) - that way you will see actual cursor and it's movement.

Position you get in reports is position of floating cursor in that input. So it hit boundaries and don't move.

yury avatar Apr 17 '18 05:04 yury

I got this sort of working, needs something clever done because right now it hits limits in the middle of the screen. I tried having an invisible array of characters where the cursor is continuously reset to the middle but could not yet make it update cursor position to the middle.

robotjosh avatar Jun 27 '18 17:06 robotjosh

You can try to set big margins or padding in text container. I remember that did the trick with movement bounds. But still didn't get it how do the math correctly :)

yury avatar Jun 27 '18 17:06 yury

I want to make the bounds infinite, no problem if it continues to send left key presses when it’s already farthest left. On Wed, Jun 27, 2018 at 12:20 PM Yury Korolev [email protected] wrote:

You can try to set big margins or padding in text container. I remember that did the trick with movement bounds. But still didn't get it how do the math correctly :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/blinksh/blink/issues/400#issuecomment-400763326, or mute the thread https://github.com/notifications/unsubscribe-auth/ABM7hqgpHSvFqfBYQ809vZL--zmhs_8Oks5uA77egaJpZM4Qtx9n .

robotjosh avatar Jun 27 '18 17:06 robotjosh

@robotjosh can you push you branch somewhere? I can take a look on issue with sizes.

yury avatar Jun 28 '18 08:06 yury