Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

密码回显为“*” #165

Open
WenShuiLiangFeng opened this issue Sep 2, 2023 · 1 comment
Open

密码回显为“*” #165

WenShuiLiangFeng opened this issue Sep 2, 2023 · 1 comment

Comments

@WenShuiLiangFeng
Copy link

WenShuiLiangFeng commented Sep 2, 2023

密码回显

您好,我定义了这样一个函数

/**
* @brief shell写字符,但会判断解锁状态,未解锁只显示'*'
 * 
 * @param shell shell对象
 * @param data 字符数据
 */
static void shellCheckWriteByte(Shell *shell, char data)
{
	static char s='*';
	if(shell->status.isChecked)
		shell->write(&data, 1);
	else
		shell->write(&s, 1);
}

并用该函数替换了void shellRight(Shell *shell)void shellInsertByte(Shell *shell, char data)函数中调用的shellCheckWriteByte

以此实现了输入密码回显为指定字符,请问您会有计划将改功能添加到cfg中吗?

@NevermindZZT
Copy link
Owner

可以加这个功能,但是要考虑完整些,退格,光标移动都需要做处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants