magicmars Member Licensed User Longtime User May 4, 2021 #1 Hi, I need to do something when the user change the cursor position in an editText. There is natively no event to handle the cursor changing position in an Edit text (it just handle the text and focus changing). As i can see , it's possible to create such a listener in java with class override : Android EditText listener for cursor position change Is it possible to do such a "onSelectionChanged" event in B4X for the editext ? Thank you for reply
Hi, I need to do something when the user change the cursor position in an editText. There is natively no event to handle the cursor changing position in an Edit text (it just handle the text and focus changing). As i can see , it's possible to create such a listener in java with class override : Android EditText listener for cursor position change Is it possible to do such a "onSelectionChanged" event in B4X for the editext ? Thank you for reply
magicmars Member Licensed User Longtime User May 4, 2021 #2 I found a workaround by adding a timer, that will check the SelectionStart every 400ms. B4X: Copy Sub Timer1_Tick If edttxtBot.SelectionStart <> lastCursorPosition Then Log ("cursor change") lastCursorPosition = edttxtBot.SelectionStart End If End Sub Upvote 0
I found a workaround by adding a timer, that will check the SelectionStart every 400ms. B4X: Copy Sub Timer1_Tick If edttxtBot.SelectionStart <> lastCursorPosition Then Log ("cursor change") lastCursorPosition = edttxtBot.SelectionStart End If End Sub