New ask Hacker News story: Ask HN: Why is working with contenteditable is so hard?
Ask HN: Why is working with contenteditable is so hard?
4 by raxrb | 2 comments on Hacker News.
How to reliably insert text across input fields, contenteditable divs etc across various websites in the browser via a Chrome extension or a desktop app? I am working on an accessibility application, and that application should do two things: 1. When a user presses a certain button, the current location at which the cursor is, whatever the user is saying should be inserted. 2. If the user issues commands like "delete last line" certain parts of the text could be deleted. How can I build this? I have a few ideas in my mind: - First option is simulating keystrokes, but the problem with this is if the text is longer, it is going to take a longer time to insert, but modifying the text will be a problem. - Second, I was thinking of simulating selection and pasting using ctrl-A and ctrl v, It will work for the insertion for empty fields but the problem is if there is already some text in the div or content editable, everything is going to be selected and removed. Is there way to select only certain text insted of all text? - Third is writing a custom wrapper for each website based on the content editable that they are using. The problem with the third one is it is going to be very extensive because it will require a lot of time investment. I see desktop apps like Windows dictation tools work seamlessly everywhere. How are they working seamlessly across every input field? How can I acheive the same? Any open source software to look at for this?
4 by raxrb | 2 comments on Hacker News.
How to reliably insert text across input fields, contenteditable divs etc across various websites in the browser via a Chrome extension or a desktop app? I am working on an accessibility application, and that application should do two things: 1. When a user presses a certain button, the current location at which the cursor is, whatever the user is saying should be inserted. 2. If the user issues commands like "delete last line" certain parts of the text could be deleted. How can I build this? I have a few ideas in my mind: - First option is simulating keystrokes, but the problem with this is if the text is longer, it is going to take a longer time to insert, but modifying the text will be a problem. - Second, I was thinking of simulating selection and pasting using ctrl-A and ctrl v, It will work for the insertion for empty fields but the problem is if there is already some text in the div or content editable, everything is going to be selected and removed. Is there way to select only certain text insted of all text? - Third is writing a custom wrapper for each website based on the content editable that they are using. The problem with the third one is it is going to be very extensive because it will require a lot of time investment. I see desktop apps like Windows dictation tools work seamlessly everywhere. How are they working seamlessly across every input field? How can I acheive the same? Any open source software to look at for this?
Comments
Post a Comment