使用可视化创建事件处理按钮程序
我将尽力解释这一点。我目前有一个程序,目前只需单击我创建的一些按钮图形即可循环浏览菜单。我还使用 CE 模拟器来模拟程序的运行情况。我已经为该设备创建了一个皮肤,并添加了按钮(请参阅下面的 xml),这些按钮在按下时会发出指示。我基本上想让实际的程序按钮静态化,并使皮肤按钮执行程序按钮将执行的操作(循环菜单等)。我只是想让皮肤按钮做出相应的动作。抱歉,这真的很模糊,我将不胜感激任何帮助,谢谢。
<?xml version="1.0" encoding="UTF-8"?>
<skin>
<view titleBar="SalusSdk" displayWidth="480" displayHeight="272" displayPosX="147" displayPosY="103" displayDepth="16" mappingImage="down.png" normalImage="defaultskin.png" downImage="Up.png">
<button
toolTip="Button one"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFFF200"
/>
<button
toolTip="Button two"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0x3F48CC"
/>
<button
toolTip="Button three"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0x22B14C"
/>
<button
toolTip="Button four"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFFAEC9"
/>
<button
toolTip="Button five"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFF8000"
/>
<button
toolTip="Button five"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xA349A4"
/>
</view>
</skin>
I will try to explain this the best that I can. I currently have a program that at the moment just cycles through menus by clicking some button graphics that I have created. I am also using CE emulator to have an emulation of what the program will be on. I have created a skin for the device and added buttons (see xml below) that make an indication when they are pressed. I basically want to make the actual program buttons static and make the skin buttons do what the program buttons would do (cycle through menus etc). I just want to make the skin buttons act accordingly. Sorry this is really vague, I will be grateful for any help thank you.
<?xml version="1.0" encoding="UTF-8"?>
<skin>
<view titleBar="SalusSdk" displayWidth="480" displayHeight="272" displayPosX="147" displayPosY="103" displayDepth="16" mappingImage="down.png" normalImage="defaultskin.png" downImage="Up.png">
<button
toolTip="Button one"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFFF200"
/>
<button
toolTip="Button two"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0x3F48CC"
/>
<button
toolTip="Button three"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0x22B14C"
/>
<button
toolTip="Button four"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFFAEC9"
/>
<button
toolTip="Button five"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xFF8000"
/>
<button
toolTip="Button five"
onClick=" DOWN:Key_LeftShift
Key_Z
0x00000015
UP: Key_LeftShift
Key_A"
onPressAndHold="Key_B"
mappingColor="0xA349A4"
/>
</view>
</skin>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您基本上需要您的应用程序来处理由皮肤按钮生成的击键。在您的skin.xml 中,所有按钮都会生成相同的击键,因此您需要对其进行更改,以便它们是唯一的。我首先连接按键处理并使用常规键盘进行测试,然后摆弄皮肤按钮以匹配。
You basically need your application to handle the keystrokes generated by the skin's buttons. In your skin.xml all the buttons generate the same keystroke, so you'll want to change that so they are unique. I'd first hook up the key handling and test using the regular keyboard, then fiddle with the skin buttons to match.