DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by Joe » 03 Oct 2013, 01:28

Besten Dank, dass du dich drum kümmerst. Ich hatte mir auch schon gedacht, dass es ein bekanntes Problem ist, und lange danach gesucht.

Inzwischen habe ich aber selber funktionierenden Code:

Code: Select all

#NoEnv
#SingleInstance, Force
SendMode Input
SendLevel 1

html =
(
  <html>
  <body>
  <input type="text" id="edit">
  </body>
  </html>
)

Gui, Add, ActiveX, w200 h100 vIE, HTMLFile
IE.write(html)
Gui, Show,, MyIEControl
IE.getElementById("edit").focus()
Send, 1234{left}{left}{del}
Return

#IfWinActive, MyIEControl
Del::
  range := IE.selection.createRange()
  if(range.parentElement().tagName = "input")
  {
    if StrLen(range.text)            ; es ist Text markiert
    {
      range.text := ""
      Send, {down}                   ; Pfeiltaste macht Cursor sichtbar (zumindest bei mir)
    }
    else
    {
      range.moveEnd("character", 1)  ; nächstes Zeichen markieren
      range.text := ""
    }
  }
Return
#If

GuiClose:
ExitApp
Aber natürlich bin ich noch an einer Profi-Lösung interessiert.

P.S.: Ich sehe gerade, dass sinkface was gepostet hat: viewtopic.php?p=601#p601
Wenn ich Zeit habe, werde ich mir das mal genauer ansehen.

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by nnnik » 02 Oct 2013, 10:45

Du musst drumherum arbeiten (Workaround).
Tank wird wahrscheinlich bald die Lösung aus dem alten Forum posten.

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by SAPlayer » 02 Oct 2013, 10:43

Falls du es noch nicht gesehen hast: http://auto-hotkey.com/boards/viewtopic.php?f=14&t=86

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by Joe » 02 Oct 2013, 05:42

Ja danke, sieht mir auch nach Bug aus. Man kann das sicher nachbauen, wenn man weiß, ob und an welcher Stelle Text markiert ist, wo der Cursor steht usw. Zumindest mit JS ginge das, ist aber natürlich etwas umständlich.

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by nnnik » 02 Oct 2013, 04:50

Das ist wahrschinlich ein Bug.
Ich werde das mal beiLexicos melden.

Re: DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by Joe » 02 Oct 2013, 04:47

gero schrieb in http://www.autohotkey.com/board/topic/9 ... ntry616568:
Die Del-Taste entfernt IMHO nur markierten Text.
Nö, zumindest bei mir macht sie gar nichts. Es scheint so, als ob sie nicht ans Browser-Plugin weitergegeben wird. Vielleicht ein Bug?

Gruß
Joe

DEL-Taste funktioniert nicht in HTML-Eingabefeldern

Post by Joe » 02 Oct 2013, 04:31

Hallo,

bisher habe ich es nicht hinbekommen, in einem Eingabefeld im Browserplugin die DEL-Taste zum Laufen zu bringen. Weder über Script noch über manuelle Tastatureingabe kann ich mit DEL in einem Input (oder Textarea) irgendetwas löschen. Weiß jemand, warum das so ist?

Besten Dank für Hinweise!

Code: Select all

#NoEnv
#SingleInstance, Force
SendMode Input

html =
(
  <html>
  <body>
  <input type="text" id="edit">
  </body>
  </html>
)

Gui, Add, ActiveX, w200 h100 vIE, HTMLFile
IE.write(html)
Gui, Show
IE.getElementById("edit").focus()
Send, 1234{left}{left}{del}
Return

; Das funktioniert:
; ~del::
; msgbox del
; Return

GuiClose:
ExitApp

Top