我需要箭头键的ASCII值。 [英] I need the ASCII values of the arrow keys.

查看:169
本文介绍了我需要箭头键的ASCII值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网上搜索箭头键的ASCII但没有运气。我需要将它用于我的程序,这是一个8086组装的蛇游戏。我们的任务是使用WSAD和箭头键进行蛇游戏。我唯一缺少的是箭头键。有什么我可以使用???谢谢

解决方案

SO:左上方的ascii值是多少? [ ^ ]



一个有趣的讨论,你将能够找到关于方向键以及如何处理它们的一些有用的东西。


箭头键没有ASCII值 - 它们不是字符(这是所有ASCII字符集所关注的)



我假设您使用的是INT 16H服务?如果没有,那么你需要。

AH == 0读取键盘输入: http://webpages.charter.net/danrollins/techhelp/0229.HTM [ ^ ]和IIRC up键将在AL中返回值48,依此类推。


ASCII上没有这样的东西: http://en.wikipedia.org/wiki/ASCII [ ^ ]。



这不是用DOS做的。 。相反,您根据视频模式将所需的字符位图加载到视频卡,通常采用扩展ASCII(不是标准的,请参阅http://en.wikipedia.org/wiki/Extended_ASCII [ ^ ])并以通常的方式输出这些字符。



从你的问题来看,目的不明确。也许您不需要显示箭头,只需处理按键点击即可。然后你可以使用与字符无关的扫描码,ASCII码与否。



-SA

ive been searching the net for the ASCII of the arrow keys but no luck. i need to use it for my program which is a snake game on assembly 8086. we were tasked to make a snake game using WSAD and the arrows keys. the only thing im missing is the arrow keys. is there anything I can use??? thank you

解决方案

SO: What are the ascii values of up down left right?[^]

An interesting discussion where you will be able to find something useful about direction keys and how to handle them.


Arrow keys don't have "ASCII values" - they aren't characters (which is all the ASCII character set is concerned with)

I assume you are using INT 16H services? If not, then you need to.
The AH == 0 reads the keyboard input: http://webpages.charter.net/danrollins/techhelp/0229.HTM[^] and IIRC the up key will return a value of 48 in AL, and so on.


There are no such thing on ASCII: http://en.wikipedia.org/wiki/ASCII[^].

This is not how it's done with DOS. Instead, you load the character bitmaps you want to the video card, depending on your video mode, usually in "extended ASCII" (not a standard thing, please see http://en.wikipedia.org/wiki/Extended_ASCII[^]) and output those characters in the usual way.

From your question, the purpose is unclear. Perhaps you don't need to show the arrows, but just handle the key clicks. Then you can to use scan code which don't have anything to do with characters, ASCII or not.

—SA


这篇关于我需要箭头键的ASCII值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆