pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Cardkb

案例程序

打印按键的数值

from m5stack import *
from m5ui import *
from uiflow import *
import hat

setScreenColor(0x111111)

hat_cardkb_1 = hat.get(hat.CARDKB)

print(hat_cardkb_1.keyData)
print(hat_cardkb_1.keyString)
print(hat_cardkb_1.isNewKeyPress())

功能说明

hat_cardkb_0.keyData
  • 获取按下的单个键值
hat_cardkb_0.isNewKeyPress()
  • 获取当前被按下的按键状态
hat_cardkb_0.keyString
  • 获取输入的字符串
On This Page