# 一个桌面虚拟数字小键盘

**URL:** <https://meta.appinn.net/t/topic/514>\
**Category:** 问题求助\
**Created:** [2014 年10 月 22 日 15:45 UTC](https://meta.appinn.net/t/topic/514 "2014-10-22T15:45:28Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2014 年10 月 22 日 15:45 UTC](https://meta.appinn.net/t/topic/514/1 "2014-10-22T15:45:28Z")

</div>

因为[http://appinn.me/d/580/](http://appinn.me/d/580/) 里面, @qq88178813 找不到, 我晚上没事随手写了一个.

用ahk写的,难度倒是不大,不过在输出时用了好几种方案, 最后感觉还是背景发送(ControlSend)的方式感观最好.

所以耽误了不少时间.

![](https://meta.appinn.net/uploads/default/413/d24c4ece552c7a66.jpg)

下载地址:~~[百度网盘-链接不存在](http://pan.baidu.com/s/1qW4XaAo)~~

> **[百度网盘-链接不存在](http://pan.baidu.com/s/1ntDkFTB)**
>
> 百度网盘为您提供文件的网络备份、同步和分享服务。空间大、速度快、安全稳固，支持教育网加速，支持手机端。注册使用百度网盘即可享受免费存储空间

因为是AHK写的, 所以个别杀毒软件会有报警提示. 担心的话勿下.

; ver1.1 2014.10.23 增加()按钮功能.  
; ver1.2 修正个别输出字符在unicdoe和ansi之间混乱显示的情况. 比如\*输出为8,(输出为9

---

<div class="post-metadata">

作者： ![scavin](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/scavin/32/2_2.png) [@scavin](https://meta.appinn.net/u/scavin)\
发布日期： [2014 年10 月 22 日 16:53 UTC](https://meta.appinn.net/t/topic/514/2 "2014-10-22T16:53:24Z")

</div>

高大上啊

---

<div class="post-metadata">

作者： ![qq88178813](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/q/6de8d8/32.png) [@qq88178813](https://meta.appinn.net/u/qq88178813)\
发布日期： [2014 年10 月 23 日 03:45 UTC](https://meta.appinn.net/t/topic/514/3 "2014-10-23T03:45:28Z")

</div>

能不能加入（）方便输入计算式，还有就是为什么我不能输入，一点键盘就成了当前窗口了，没有办法输入到excel里面去。

---

<div class="post-metadata">

作者： ![diystar](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/diystar/32/40_2.png) [@diystar](https://meta.appinn.net/u/diystar)\
发布日期： [2014 年10 月 23 日 04:34 UTC](https://meta.appinn.net/t/topic/514/4 "2014-10-23T04:34:08Z")

</div>

@qq88178813

界面上有一句提示：在激活窗口按Win+K获取焦点。不知道有没有帮助…

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2014 年10 月 23 日 04:48 UTC](https://meta.appinn.net/t/topic/514/5 "2014-10-23T04:48:08Z")

</div>

@qq88178813 新版本增加了()

不过我发现一个AHK自身的bug. 导致快速重复点击时, 个别按钮的输出会混乱. 我调试了很久, 发现不是代码的问题. 而是AHK本身的问题. 但是原因还不得而知. 所以暂时不会放出新版本了.

---

<div class="post-metadata">

作者： ![qq88178813](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/q/6de8d8/32.png) [@qq88178813](https://meta.appinn.net/u/qq88178813)\
发布日期： [2014 年10 月 23 日 06:11 UTC](https://meta.appinn.net/t/topic/514/6 "2014-10-23T06:11:34Z")

</div>

@小恐龙 那个一点键盘就成了当前窗口了，没有办法输入到excel里面去。这个问题是不是我哪里不会操作？

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2014 年10 月 23 日 07:08 UTC](https://meta.appinn.net/t/topic/514/7 "2014-10-23T07:08:37Z")

</div>

@qq88178813 代码采用了ControlSend, 会在背景对指定焦点的窗体输出字符. 但是经我测试, 部分按钮会输出混乱.

但是采用切换焦点的输出对用户的观感不好.正在寻求解决中…

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2014 年10 月 23 日 07:09 UTC](https://meta.appinn.net/t/topic/514/8 "2014-10-23T07:09:33Z")

</div>

@qq88178813 已更新,现在可以了.已经解决了.

---

<div class="post-metadata">

作者： ![qq88178813](https://meta-edge.appinn.com/letter_avatar_proxy/v4/letter/q/6de8d8/32.png) [@qq88178813](https://meta.appinn.net/u/qq88178813)\
发布日期： [2014 年10 月 23 日 09:35 UTC](https://meta.appinn.net/t/topic/514/9 "2014-10-23T09:35:49Z")

</div>

@小恐龙 非常完美。

---

<div class="post-metadata">

作者： ![scavin](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/scavin/32/2_2.png) [@scavin](https://meta.appinn.net/u/scavin)\
发布日期： [2014 年10 月 24 日 03:16 UTC](https://meta.appinn.net/t/topic/514/10 "2014-10-24T03:16:55Z")

</div>

已分享：[NumPad - 虚拟数字小键盘，适合 Excel 录入[Win] - 小众软件](http://www.appinn.com/numpad-win/)

---

<div class="post-metadata">

作者： ![Leonard](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/leonard/32/1952_2.png) [@Leonard](https://meta.appinn.net/u/Leonard)\
发布日期： [2014 年11 月 11 日 14:21 UTC](https://meta.appinn.net/t/topic/514/11 "2014-11-11T14:21:26Z")

</div>

其實Windows自帶的屏幕鍵盤就有 當然這個更簡單一點

---

<div class="post-metadata">

作者： ![feeshy](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/feeshy/32/55260_2.png) [@feeshy](https://meta.appinn.net/u/feeshy)\
发布日期： [2021 年6 月 29 日 05:14 UTC](https://meta.appinn.net/t/topic/514/12 "2021-06-29T05:14:40Z")

</div>

挖坟  
小恐龙还有保留源码吗 :joy:  
现在Win+K是显示器和蓝牙音频，想更换一下激活的快捷键

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2021 年6 月 29 日 05:59 UTC](https://meta.appinn.net/t/topic/514/13 "2021-06-29T05:59:06Z")

</div>

> [@feeshy](#):
>
> 小恐龙还有保留源码吗 :joy:

没有保留了.

不过这个是ahk编译的, 你反编译一下试试.

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2021 年6 月 29 日 06:03 UTC](https://meta.appinn.net/t/topic/514/14 "2021-06-29T06:03:07Z")

</div>

幸好我的百度网盘里还有exe程序, 我下载回来后, 反编译了一下. 代码你自己改.

```autohotkey
Menu, Tray, Icon, Shell32.dll, 174
Gui, Add, Button, x132 y130 w40 h80 , Enter
Gui, Add, Text,x12 y255 w165 h40, 在激活窗口按 Win+K 获取焦点
Gui, Font, s14, Arial
Gui, Add, Button, x12 y10 w40 h40 , =
Gui, Add, Button, x52 y10 w40 h40 , /
Gui, Add, Button, x92 y10 w40 h40 , ＊
Gui, Add, Button, x132 y10 w40 h40 , -
Gui, Add, Button, x12 y50 w40 h40 , 7
Gui, Add, Button, x52 y50 w40 h40 , 8
Gui, Add, Button, x92 y50 w40 h40 , 9
Gui, Add, Button, x12 y90 w40 h40 , 4
Gui, Add, Button, x52 y90 w40 h40 , 5
Gui, Add, Button, x92 y90 w40 h40 , 6
Gui, Add, Button, x12 y130 w40 h40 , 1
Gui, Add, Button, x52 y130 w40 h40 , 2
Gui, Add, Button, x92 y130 w40 h40 , 3
Gui, Add, Button, x92 y170 w40 h40 , .
Gui, Add, Button, x132 y50 w40 h80 , +
Gui, Add, Button, x12 y170 w80 h40 , 0
Gui, Add, Button, x12 y210 w80 h40 , (
Gui, Add, Button, x92 y210 w80 h40 , )
id := WinExist("A")
Gui, Show,NoActivate x606 y300 h280 w185, NumPad
Gui, +AlwaysOnTop
return
IfWinNotActive,Numpad
id := WinExist("A")
trayTip NumPad by 小恐龙, 获取输入焦点%id%
return
SetKeyDelay, -1, 0
ButtonEnter:
ControlSend ,,{Enter},ahk_id %id%
return
Button=:
ControlSend ,,=,ahk_id %id%
return
Button/:
ControlSend ,,/,ahk_id %id%
return
button＊:
ControlSend ,,{U+002a},ahk_id %id%
return
button+:
ControlSend ,,{U+002b},ahk_id %id%
return
button-:
ControlSend ,,-,ahk_id %id%
return
button1:
ControlSend ,,1,ahk_id %id%
return
button2:
ControlSend ,,2,ahk_id %id%
return
button3:
ControlSend ,,3,ahk_id %id%
return
button4:
ControlSend ,,4,ahk_id %id%
return
button5:
ControlSend ,,5,ahk_id %id%
return
button6:
ControlSend ,,6,ahk_id %id%
return
button7:
ControlSend ,,7,ahk_id %id%
return
button8:
ControlSend ,,8,ahk_id %id%
return
button9:
ControlSend ,,9,ahk_id %id%
return
button0:
ControlSend ,,0,ahk_id %id%
return
button.:
ControlSend ,,.,ahk_id %id%
return
Button(:
ControlSend ,,{U+0028},ahk_id %id%
return
Button):
ControlSend ,,{U+0029},ahk_id %id%
return
#K::
id := WinExist("A")
Gui, Show,NoActivate
trayTip,NumPad by 小恐龙, 获取输入焦点%id%
return
GuiClose:
trayTip,NumPad by 小恐龙, 快捷键Win+K显示小键盘
Gui, Cancel
return

```

---

<div class="post-metadata">

作者： ![feeshy](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/feeshy/32/55260_2.png) [@feeshy](https://meta.appinn.net/u/feeshy)\
发布日期： [2021 年6 月 29 日 07:23 UTC](https://meta.appinn.net/t/topic/514/15 "2021-06-29T07:23:28Z")

</div>

感谢感谢！

---

<div class="post-metadata">

作者： ![feeshy](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/feeshy/32/55260_2.png) [@feeshy](https://meta.appinn.net/u/feeshy)\
发布日期： [2021 年6 月 29 日 10:15 UTC](https://meta.appinn.net/t/topic/514/16 "2021-06-29T10:15:50Z")

</div>

我把快捷键改成了 右Ctrl+0，UI放大到150%便于触屏操作。。。

> ****
>
> ![image](https://meta.appinn.net/uploads/default/original/3X/3/d/3d881949c7042dd8b5c9e6bb05d3e32065637d52.png)
> 
> ```auto
> Menu, Tray, Icon, Shell32.dll, 174
> Gui, Font, s12, Courier New Bold
> Gui, Add, Button, x18 y15 w60 h60, =
> Gui, Add, Button, x78 y15 w60 h60, /
> Gui, Add, Button, x138 y15 w60 h60, ＊
> Gui, Add, Button, x198 y15 w60 h60, -
> Gui, Add, Button, x18 y75 w60 h60, 7
> Gui, Add, Button, x78 y75 w60 h60, 8
> Gui, Add, Button, x138 y75 w60 h60, 9
> Gui, Add, Button, x198 y75 w60 h120, +
> Gui, Add, Button, x18 y135 w60 h60, 4
> Gui, Add, Button, x78 y135 w60 h60, 5
> Gui, Add, Button, x138 y135 w60 h60, 6
> Gui, Add, Button, x18 y195 w60 h60, 1
> Gui, Add, Button, x78 y195 w60 h60, 2
> Gui, Add, Button, x138 y195 w60 h60, 3
> Gui, Add, Button, x198 y195 w60 h120 , Enter
> Gui, Add, Button, x138 y255 w60 h60, .
> Gui, Add, Button, x18 y255 w120 h60, 0
> Gui, Add, Button, x18 y315 w60 h60, (
> Gui, Add, Button, x78 y315 w60 h60, )
> Gui, Add, Button, x138 y315 w60 h60, ⇧Tab
> Gui, Add, Button, x198 y315 w60 h60, Tab
> Gui, Add, Text,x18 y385 w248 h60, 在激活窗口按 RCtrl+0 获取焦点
> id := WinExist("A")
> Gui, Show,NoActivate x1600 y500 h430 w276, NumPad
> Gui, +AlwaysOnTop
> return
> IfWinNotActive,Numpad
> id := WinExist("A")
> trayTip NumPad by 小恐龙, 获取输入焦点%id%
> return
> SetKeyDelay, -1, 0
> Button⇧Tab:
> ControlSend ,,+{Tab},ahk_id %id%
> return
> ButtonTab:
> ControlSend ,,{Tab},ahk_id %id%
> return
> ButtonEnter:
> ControlSend ,,{Enter},ahk_id %id%
> return
> Button=:
> ControlSend ,,=,ahk_id %id%
> return
> Button/:
> ControlSend ,,/,ahk_id %id%
> return
> button＊:
> ControlSend ,,{U+002a},ahk_id %id%
> return
> button+:
> ControlSend ,,{U+002b},ahk_id %id%
> return
> button-:
> ControlSend ,,-,ahk_id %id%
> return
> button1:
> ControlSend ,,1,ahk_id %id%
> return
> button2:
> ControlSend ,,2,ahk_id %id%
> return
> button3:
> ControlSend ,,3,ahk_id %id%
> return
> button4:
> ControlSend ,,4,ahk_id %id%
> return
> button5:
> ControlSend ,,5,ahk_id %id%
> return
> button6:
> ControlSend ,,6,ahk_id %id%
> return
> button7:
> ControlSend ,,7,ahk_id %id%
> return
> button8:
> ControlSend ,,8,ahk_id %id%
> return
> button9:
> ControlSend ,,9,ahk_id %id%
> return
> button0:
> ControlSend ,,0,ahk_id %id%
> return
> button.:
> ControlSend ,,.,ahk_id %id%
> return
> Button(:
> ControlSend ,,{U+0028},ahk_id %id%
> return
> Button):
> ControlSend ,,{U+0029},ahk_id %id%
> return
> >^0::
> id := WinExist("A")
> Gui, Show,NoActivate
> trayTip,NumPad by 小恐龙, 获取输入焦点%id%
> return
> GuiClose:
> trayTip,NumPad by 小恐龙, 快捷键RCtrl+0显示小键盘
> Gui, Cancel
> return
> 
> ```

然后发现ControlSend操作在现在好多界面丰富的软件中都聚焦不到正确的控件了。。。只能在记事本和Excel用一用 :joy:

再后来发现原来市面上有单独卖的只带数字区的硬件小键盘，只要三五十块钱，把NumLock关了还能用Insert Delete Home End PageUp PageDown :joy:

---

<div class="post-metadata">

作者： ![xiaokonglong](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/xiaokonglong/32/908_2.png) [@xiaokonglong](https://meta.appinn.net/u/xiaokonglong)\
发布日期： [2021 年6 月 30 日 01:10 UTC](https://meta.appinn.net/t/topic/514/17 "2021-06-30T01:10:24Z")

</div>

我买键盘必须全尺寸的. 没有小键盘区受不了. :rofl:

---

<div class="post-metadata">

作者： ![feeshy](https://meta-edge.appinn.com/user_avatar/meta.appinn.net/feeshy/32/55260_2.png) [@feeshy](https://meta.appinn.net/u/feeshy)\
发布日期： [2021 年6 月 30 日 01:55 UTC](https://meta.appinn.net/t/topic/514/18 "2021-06-30T01:55:57Z")

</div>

没办法，surface没有空间放小键盘区了。

其实如果windows自带的触摸键盘能隐藏字母区，就正好可以同时用物理键盘输字母+触屏输数字了。。。但不知道是不是微软没有想到这个feature
