Deleting complete lines in TeXworks / ganze Zeilen löschen in TeXworks

What I really like in Emacs is the Ctrl+k key combination to delete the rest of the line. As I wanted this feature in TeXworks as well, where I usually set the cursor to the beginning of the line anyway I decided to implement a little Autohotkey script to do this. As I do not want this script to overwrite Emacs‘ own Ctrl-k I check if the window is an instance of the ‚QWidget‘ class (check with Autohotkey’s WindowSpy).

#IfWinActive ahk_class QWidget
^k::
Send {home}
Send {Shift}+{End}
Send {Del 2}
return