您现在的位置:掌上风云 >> 文章中心 >> PSP (PlayStation Portable)>> PSP DOSBox 键盘映射 (p-sprint)

PSP DOSBox 键盘映射 (p-sprint)

【字体: 收藏 打印文章
作者:Pocketwind 来源:本站原创 发布时间:2008年03月28日 点击数:
 

p-sprint Keymap v. 0.63a - 102 key compatibility mode
p-sprint 键盘映射 v. 0.63a - 102 键兼容模式

( Pocketwind 译。 用于 psp DOSBox 输入操作。对于不需要使用大量键盘操作的游戏,可以直接使用 INPUTMAP 来定义)

last edited 30 august 2005
最后更新日期:2005年8月30日
- fixed a few keymappings in the documentation (the alphabet keycodes actually had the ASCII values and the Function keys were off too)
- 修正了文档中的少数几个键盘映射
- added the OS/shift key to the list
- 列表中增加了 OS/shift 键
- added comment on possibility of combining SHIFT keys
- 增加了可能用到 SHIFT 的组合键说明

Introduction
介绍

This is a description of the p-sprint keyboard emulator. The p-sprint keyboard emulator provides a full 114 key-set to cover all 102 keys of a pc-style keyboard. The program has been written as an include for c projects and is designed to make integration into your own applications as easy as possible. Because the system does not require an on-screen keyboard, it is particularly suitable for software that is ported to the PSP from a system that expects full keyboard support.
本文描述了p-sprint键盘模拟器。本键盘模拟了完整的114键,覆盖了全部用于PC的102键。本程序使用c语言编写,可以作为项目的包含文件,非常简便的集成在您的应用当中。因为系统不需要屏幕显示的键盘,所以特别适合于用于PSP系统的,并需要完整键盘支持的软件。( Pocketwind 注释:比如 DOSBox for PSP,在命令行状态下,可能会用到所有的键。)

Here is an illustration of how p-sprint maps button presses to a keyboard (this is just a fragment, in reality all keys including function and keypad keys are mapped. If there are symbols in two colors, the white symbol is the first button you press, the coloured one the second. Compare the letter A to the example given below under 'How does it work?'.
这里有一个怎样按键的插图(这只是主键盘部分,事实上,所有的键包括功能键和小键盘上的键都有映射)。如果键上是用两种颜色标出的,那么白色的要先按,彩色的后按。请对照图示里面的字母A,想一想,“怎样做?”

How does it work?
怎样做?按键的方法

Obviously, the playstation controller doesn't have 102 keys, so a way was needed to select keys using less buttons. P-sprint does this by using sequential key combinations for regular key selection, and sequential key combinations with holds for immediate shift, alt, control and group selections.
显然,PSP上根本没有102个键,所以需要有一个方法,使用很少的键来选择并敲出这些键(102键)。P-sprint就实现了这个功能,它通过使用序列组合按键来选择常规键值,并且使用保持序列组合按键来实现 shift,alt,ctrl和组的选择。

Pocketwind 提示,下面的动作称谓的定义:
按下:表示按下后马上释放。
按下并保持:表示按下后不释放,需要释放的时候会有明确的指令。

Sequential key combinations means that you first press one button, and then another. For instance, if you press  (Square) in p-sprint, followed by  (Triangle), you get an 't'.
序列组合按键意思是,先按下一个键,然后按下另外一个。比如,如果先按下(方块),再按下(三角),就会得到字母 't'。

A hold is that you first press one button, keep that button pressed, and then press another button. Say that you wanted to type a capital letter 'T'. First you press , and then you hold this button while you press . Now you've selected Shift. If you finally press , you will have typed an 'T'.
保持序列组合按键的意思是,先按下一个键,保持按下不要释放,然后按下另外一个键。比如说您要输入大写字母 'T'。首先按下,并保持按下不要释放,同时按下(上方向键,也就是相当于按下了Shift),然后两个同时释放,最后按下,您将敲出字母 'T'。( Pocketwind 解释:这里用到了下面要讲的 上档键方法)

In the key overview below, all Hold combinations are indicated with an '+', and all regular combinations are indicated with a ','. So, say you were to describe the 't' and the 'T', you would get:
在下面的键值列表中,所有的保持组合键用加号'+'来标明,而所有的普通序列组合键用逗号','标明。所以如果要描述字母 't'和'T'的按键方法,就应该像下面这样:

,  = 't'

+,  = 'T'

Key Layout and Groups
键的排布和分组

For easy typing, p-sprint limits itself mostly to the top three keys of each side of the screen (up,right,left and square,triangle,circle). By keeping cross and down clear from normal combinations, they only have to be pressed once to return a value. This is valuable for keys that are used often, like space and backspace.
为了输入更简单,p-sprint约定用于组合的键,只使用屏幕每侧的上面三个键(左侧三个:上,左,右;右侧三个:方块,三角,圆)。为了区别于常规组合键,对于下和叉,只需要按一下,就可以得到键值。这对于经常使用的键是非常有用的,比如空格键和退格键。

As a result, you have 38 combinations for the regular face buttons. As this does not nearly cover 102 keys yet, a group-select option has been added to p-sprint. Through a hold-combination, you can select 1 of 6 different groups of keys. The first three are default groups designed for compatibility and cover the 102 basic keys in a layout designed for general purpose pc-keyboard compatibility environments.
这样,对于标准按键,将产生38种组合(就是个排列6*6+2)。但是这些仍然不能全面覆盖102键,所有p-sprint加入了按键组选择。通过一个保持组合键,您可以选择6个不同的按键组。

Here's a small overview of the basic keys in each group.
这里是一个每个组(前三组)中的基本按键一览。
Pocketwind 注释:注意箭头方向。下面的图中只是描述了可以直接相互看到的两个键的键值,对相互之间看不到的,没有画出来,请注意。比如 之间,不能用直线连起来,图上就没有标出,但是他们的组合也是有键值的,具体的看后面的102键值表。
原来的英文版标示的组号有问题,已经更正。

Group 0(按键组 0,如果当前按键组1激活,那么按下+ 返回按键组 0;如果当前按键组2激活,那么按下+ 返回按键组 0):

Group 1(按键组 1 + 激活,再次按下返回 按键组 0):

Group 2(按键组 2 + 激活,再次按下返回 按键组 0):

Custom Groups
用户自定义按键组

The second three groups are available to programmers who want to offer a set of keys that is optimised for a certain application.
后三组可以由程序设计人员使用,用于优化特定的应用。

Cross-platform compatibility
跨平台兼容

Obviously, the PSP has more buttons. For compatibility reasons under different environments, however, the default keymap only assumes those keys and all 102 keys can be found under the basic 8 buttons and their combinations and groups. The other buttons can be assigned values also, but those values should normally double values (as shortcut keys) that are also present among the regular 8 button combos.
显然,PSP有更多的键(比如肩膀上的两个键,一般用作鼠标左键和右键)。然而,为了不同环境下兼容的原因,默认键盘映射只使用这8个键。所有的102键都使用这8个键和它们的组合来完成。其他的键也能够被赋值,但是这些值就会有两个(一般都作为快捷键,只需按一下),因为这些值也会存在于标准的8键组合中。

In order to make the system work under most circumstances I have restricted the use of buttons to the d-pad and standard symbol buttons (square, triangle, cross and circle). Another advantage of this system is that it can be implemented on a large variety of console like platforms, as most of them these days have at least 8 such buttons.
为了使系统在大多数环境下正常工作,限定了只使用方向键(d-pad)和标准符号键(方块,三角,圆,叉)这8个键。其他的系统,要想实现类似功能(平台系统的控制台),最少也需要这8个键(类似的键)。

Another reason is that the analog stick and the shoulder buttons are useful to reserve for mouse emulation in environments where a mouse is applicable (like Shells, Microwindows, and so on).
限定键盘8个键的另外一个原因是控制柄或肩膀部位的按键,保留用作鼠标模拟,也是非常有用的,比如一个需要鼠标的应用(比如Shell类,窗口类,等等)

The default Keymap 默认的键盘映射

Group Selection Shortcuts
用于组选择的快捷键

Press the combination for the active group to return to the default group (Group '0' / Alphabet Keys). If you're not sure in which group you were (for instance in dosbox) you can press any of the combinations you're sure you weren't in twice.
按下当前选择的组(激活组)对应的组合键,可以返回到默认组(Group 0,按键组 0)。如果您不能确定,您现在的激活组是什么(比如DOSBox,没有显示),您可以按下任意的不是当前激活组的组合键两次。(其实可以这样,按三次,第一次先随意按下一个组合键,然后再按下另外一个组合键两次。注意这里只能使用按键组1和按键组2的快捷键)

组快捷键 p_spid 组别 解释
+ 58 Group 1 / Numbers and Function Keys 第一组 / 数字和功能键
+ 59 Group 2 / Control Keys 第二组 / 控制键
+ 60 Group 3 / Reserved 第三组 / 保留,对 DOSBox 来说没有用
+ 61 Custom Group 1 用户自定义组 1,对 DOSBox 来说没有用
+ 62 Custom Group 2 用户自定义组 2,对 DOSBox 来说没有用
+ 63 Custom Group 3 用户自定义组 3,对 DOSBox 来说没有用

Shift Methods  上档键方法

Shift methods provide a shortcut for getting the shifted value for a key. They are separate from their true keymappings and do not render a keycode. If, say in a game like Doom, you need to shoot using the Shift key, get the normal combination that is mapped to this key instead.
上档键方法提供了一个得到一个键的Shift值的快捷方法。它区别于真正的键值映射,并且不表现为一个keycode键值。当然,如果您在玩像Doom之类的游戏,需要按下Shift来射击,那么不可用这种上档键方法,您需要用常规组合键映射来代替。

You can also combine shift combinations by pressing more than one shift button while holding the first button. E.g. ctrl-alt-del would be (in group 2 mode): while holding , press , press , release , press .
您可以在按下第一个键的同时,使用上档键方法组合产生更多的键。比如下表中所述。例如,Ctrl+Alt+Del(先切换到第二组)可以这样做:按下并保持, 按下 , 按下 , 释放 , 按下 。( Pocketwind 解释:, 组合键表示 Delete,那么在按下第一个键的同时,按下出现Right Ctrl,然后按下出现Right Alt,释放,按下出现Delete。)

上档键方法的按键 上档键代表的意义 Pocketwind 操作方法解释
1st button+, 2nd button Left Shift 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button Right Shift 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button Left Control 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button Right Control 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button Left Alt 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button Right Alt 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button OS key (win/apple) 按下并保持第一个键,按下,释放第一个键,按下第二个键
1st button+, 2nd button OS key (win/apple) 按下并保持第一个键,按下,释放第一个键,按下第二个键

The default 102 keys and their mappings
默认102键映射表

p_spid 1 (shift - ctrl - alt) 2 (shift - ctrl - alt) 3 (shift - ctrl - alt)
1 Backspace - 8 Backspace - 8 Down - 40
2 Space - 32 Space - 32 Enter - 13
3 b (B) - 66 F1 - 112 Left - 37
4 y (Y) - 89 F2 - 113 Home - 36
5 g (G) - 71 F8 - 119 Insert - 45
, 6 [ ({) - 219 [ ({) - 219
, 7 ' (") - 222 ; (:) - 186
, 8 , (<) - 188 , (<) - 188
9 f (F) - 70 F3 - 114 End - 35
10 o (O) - 79 F4 - 115 Up -38
11 u (U) - 85 F5 - 116 Pg Up - 33
, 12 x (X-24) - 88 / - 111 (numpad) Break - 19
, 13 v (V-22) - 86 F12 - 113 Print Screen - 16 
, 14 ` (~) - 192 ` (~) - 192
15 j (J) - 74 F9 - 120 Delete - 46
16 l (L) - 76 F6 - 117 Pg Dwn - 34
17 d (D) - 68 F7 - 118 Right - 39
, 18 m (M) - 77 F10 - 121 + - 107(numpad)
, 19 z (Z-26) - 90 F11 - 122 * - 106 (numpad)
, 20 ] (}) - 221 ] (}) - 221
21 \ (|) - 220
22 q (Q) - 81 * - 106 (numpad) Scroll Lock - 145
23 p (P) - 80 0 ()) - - 109 (numpad)
, 24 s (S) - 83 1 (!) ESC - 27
, 25 t (T) - 84 2 (@) LPSP - 91
, 26 c (C-3) - 67 9 (() MENU - 93
27 ; (:) - 186 ; (:) - 186
28 w (W) - 87 + - 107 (numpad) Num Lock - 144
29 k (K) - 75 - - 109 (numpad)
, 30 r (R) - 82 3 (#) Ctrl - 17
, 31 e (E) - 69 4 ($) Shift - 16
, 32 a (A) - 65 5 (%) Alt - 18
33 . (>) - 190 . (>) - 190
34 - (_) - 189
35 / (?) - 191
, 36 h (H) - 72 8 (*) CAPS - 9
, 37 n (N) - 78 6 (^) RPSP - 92
, 38 i (I) - 73 7 (&) TAB - 20
39 Enter - 13 Enter - 13 Enter - 13
40 Esc - 27 Esc - 27 Esc - 27
41 TAB - 20 TAB - 20 TAB - 20
42 MENU - 93 MENU - 93 Backspace - 8

Example Code 示例代码

For example code, check out main.c in the p-sprint test application, and the special versions of the Microwindows keyboard and mouse drivers.
如果需要例子程序,请检查p_sprint测试应用中的main.c,针对窗口键盘和鼠标应用,也有特定的版本。

(will add links and paste decent example codes for specific implementations here later)
(这块地方为以后增加特殊实现方面的示例代码相关的链接或文本预留)

用户信息中心
栏目导航
找不到相关分类
本月排行TOP20
  • 没有相关内容!
    最新推荐
    动易2007 .NET版即将上市
    • 本站图标
    • 飞翔数码电子商城
    • myPDA销售网
    • 中高移动互联
    • 智能手机生活网