English
English
简体中文
日本語

UiFlow Tutorial

UiFlow1 Development Guide

Project Management

Use LTE network

UiFlow1 Blockly

Event

Unit

Hat CardKB

Example

Prints the value of the pressed key.

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())

API

hat_cardkb_0.keyData
  • Get the value of the single key pressed.
hat_cardkb_0.isNewKeyPress()
  • Get the status of the currently pressed key.
hat_cardkb_0.keyString
  • Get the input string.
Page Tools
PDF
On This Page