TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Hooking keyboard input to play Snake in Notepad.exe (2020)

88 pointsby goranmoominabout 4 years ago

8 comments

lifthrasiirabout 4 years ago
Someone also uses notepad as a debug console [1]. There is even a Rust crate for that [2].<p>[1] <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;gnazif&#x2F;ray_tracing_in_notepadexe_at_30_fps&#x2F;fr8uy2l&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;gnazif&#x2F;ray_tra...</a> (I&#x27;ve first seen this from Steve Klabnik&#x27;s tweet <a href="https:&#x2F;&#x2F;twitter.com&#x2F;steveklabnik&#x2F;status&#x2F;1263190719721766918" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;steveklabnik&#x2F;status&#x2F;1263190719721766918</a>)<p>[2] <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;notepad_logger" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;notepad_logger</a>
computerexabout 4 years ago
Could have probably gotten the keyboard input with <a href="https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;api&#x2F;winuser&#x2F;nf-winuser-getasynckeystate" rel="nofollow">https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;win32&#x2F;api&#x2F;winuser&#x2F;n...</a> instead of the hooks.
iamevnabout 4 years ago
Excellent write-up.<p>I think the first place I encountered this sort of thing in notepad was <a href="http:&#x2F;&#x2F;thesiteformerlyknownas.zachtronicsindustries.com&#x2F;notepad-weekend&#x2F;" rel="nofollow">http:&#x2F;&#x2F;thesiteformerlyknownas.zachtronicsindustries.com&#x2F;note...</a>
thefourthchimeabout 4 years ago
I did socket hooking via DLL injection for a company i worked for. I was somewhat amazed that it was allowed, and I&#x27;m amazed it still is.
评论 #26745264 未加载
评论 #26746117 未加载
amakeabout 4 years ago
It seems a lot of people have the same idea of implementing Snake where it has no business being<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;neilsardesai&#x2F;status&#x2F;1379185826920300545?s=21" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;neilsardesai&#x2F;status&#x2F;1379185826920300545?...</a>
评论 #26750917 未加载
hprotagonistabout 4 years ago
<a href="https:&#x2F;&#x2F;github.com&#x2F;emacs-mirror&#x2F;emacs&#x2F;blob&#x2F;master&#x2F;lisp&#x2F;play&#x2F;snake.el" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;emacs-mirror&#x2F;emacs&#x2F;blob&#x2F;master&#x2F;lisp&#x2F;play&#x2F;...</a><p>1997 is actually later than I would&#x27;ve thought.
评论 #26749722 未加载
Kaze404about 4 years ago
Pretty cool. The next step is, of course, porting Doom to it :)
devitabout 4 years ago
&quot;Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should.&quot;