We can analytically prove that the straight line spanned by $HK$ passes through the midpoint of $BC$ as follows. Let the side $BC$ of the triangle lies along $x$-axis, and the origin $O$ is the midpoint of $BC$. Let ther vertex $A$ is a point $(0,a)$ and the vertices $B$ and $C$ are points $(-b,0)$ and $(b,0)$ respectively ($a,b>0$). Let $I=(0,r)$ be the center of the incircle and $H=(x_h,y_h)=I+r(\cos\varphi,\sin\varphi)$. Let $R$ (resp. $S$) be the tangent point of the incircle to the side $AB$ (resp. $AC$) of the triangle $ABC$. Since the point $H$ belongs to the upper arc of the incircle spanned by the points $R$ and $S$, $\theta\le\varphi\le\pi-\vartheta$, where $\tan\theta=\tfrac ba$. Let $M=(m,h_m)$, $P=(0,h_m)$, $N=(n,h_n)$, $Q=(0,h_n)$. Collinearity of points $A$, $B$, and $M$ implies $h_m=a\left(\tfrac {m}{b}+1\right)$. Similarly, collinearity of points $A$, $C$, and $N$ implies $h_n=a\left(\tfrac {-n}{b}+1\right)$. Let $K=(x_k,y_k)$. Similarity of triangles $KMP$ and $KQN$ implies $\tfrac{x_k-m}{h_m}=\tfrac{n-x_k}{h_n}$, so $x_k=\tfrac {nh_m+mh_n}{h_m+h_n}.$ Considering an angle $NPQ$, we obtain $\tfrac{x_k-m}{y_k}=\tfrac{|PQ|}{|NQ|}=\tfrac{n-m}{h_n}$. Thus $$y_k=\frac {h_n(x_k-m)}{n-m}=\frac{h_n}{n-m}\left(\frac {nh_m+mh_n}{h_m+h_n}-m\right)=\frac {h_mh_n}{h_m+h_n}.$$ It remains to show that the points $O$, $K$, and $H$ are collinear, that is $$\frac{b}{a}\left(\frac{n}{b-n}+\frac{m}{m+b}\right)= \frac{n}{h_n}+\frac{m}{h_m}=\frac{x_k}{y_k}=\frac{x_h}{y_h}=\tfrac{\cos\varphi}{1+\sin\varphi}.$$
Since $MH\perp IH$ we have
$(r\cos\varphi-m)r\cos\varphi+\left(r(1+\sin\varphi)- a\left(\tfrac {m}{b}+1\right)\right)r\sin\varphi =0$
$(r\cos\varphi-m)\cos\varphi+\left(r(1+\sin\varphi)- a\left(\tfrac {m}{b}+1\right)\right)\sin\varphi =0$
$br-bm\cos\varphi+rb\sin\varphi-am\sin\varphi-ab\sin\varphi=0$
If $ b\cos\varphi+ a\sin\varphi =0$ then $HI\perp AB$, so $H=R$. Then $N=A$, so $Q=O$ and formally $M$ can be any point of $AB$. But in order to have the straight line spanned by $HK$ passes through $O$, we restrict ourselves to $M=R$ in this case. Then $H=M$ and $K$ belongs to $MO$.
Below we shall assume that $a\sin\varphi+ b\cos\varphi \ne 0$. Then
$m=b\frac{r(1+\sin\varphi)-a\sin\varphi }{b\cos\varphi+ a\sin\varphi}.$
It follows
$\frac{m}{m+b}=1-\frac{ a\sin\varphi+ b\cos\varphi}{b\cos\varphi+ r(1+\sin\varphi)}.$
Similarly, since $NH\perp IH$ we have
$(r\cos\varphi-n)r\cos\varphi+\left(r(1+\sin\varphi)-a\left(\tfrac{-n}{b}+1\right)\right)r\sin\varphi =0$
$br-bn\cos\varphi+rb\sin\varphi+an\sin\varphi-ab\sin\varphi=0$
If $b\cos\varphi-a\sin\varphi=0$ then $HI\perp AC$, so $H=S$. Then $M=A$, so $P=O$ and formally $N$ can be any point of $AC$. But in order to have the straight line spanned by $HK$ passes through $O$, we restrict ourselves to $M=S$ in this case. Then $H=M$ and $K$ belongs to $NO$.
Below we shall assume that $b\cos\varphi-a\sin\varphi\ne 0$. Then
$n=b\frac{r(1+\sin\varphi) -a\sin\varphi}{b\cos\varphi-a\sin\varphi }.$
It follows
$\frac{n}{b-n}=-1+\frac{b\cos\varphi-a\sin\varphi }{b\cos\varphi-r(1+\sin\varphi)}.$
Thus
$\frac{m}{m+b}+\frac{n}{b-n}=\frac{b\cos\varphi-a\sin\varphi }{b\cos\varphi-r(1+\sin\varphi)}-
\frac{ a\sin\varphi+ b\cos\varphi}{b\cos\varphi+ r(1+\sin\varphi)}=$
$\frac{2b\cos\varphi(r(1+\sin\varphi)-a\sin\varphi)}{b^2\cos^2\varphi-r^2(1+\sin\varphi)^2}$.
So it remains to verify that
$\frac ba\frac{2b\cos\varphi(r(1+\sin\varphi)-a\sin\varphi)}{b^2\cos^2\varphi-r^2(1+\sin\varphi)^2}=\frac{\cos\varphi}{1+\sin\varphi}$
It suffices to check that
$\frac{2b^2(r(1+\sin\varphi)-a\sin\varphi)}{b^2\cos^2\varphi-r^2(1+\sin\varphi)^2}=\frac{a}{1+\sin\varphi}$
$\frac{2b^2(r(1+\sin\varphi)-a\sin\varphi)}{b^2(1+\sin\varphi)(1-\sin\varphi)-r^2(1+\sin\varphi)^2}=\frac{a}{1+\sin\varphi}$
$2b^2(r(1+\sin\varphi)-a\sin\varphi)=a(b^2(1-\sin\varphi)-r^2(1+\sin\varphi))$
$(2b^2r-ab^2+ar^2)(1-\sin\varphi)=0$
That is, we need to show that $2b^2r-ab^2+ar^2=0$. That is $r=\tfrac{-2b^2\pm \sqrt{4b^4+4a^2b^2}}{2a}=\tfrac{-b^2\pm b\sqrt{b^2+a^2}}{a}$. Indeed, the radius $r$ equals the area $ab$ of the triangle $ABC$ divided by its semiperimeter $b+\sqrt{a^2+b^2}$. It follows $r=\frac ba\left(\sqrt{a^2+b^2}-b \right)$.