-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for system keyboard in string/number prompts
- Loading branch information
Showing
5 changed files
with
223 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include "pxt.h" | ||
|
||
namespace Keyboard { | ||
|
||
//% | ||
void promptForText(int maxLength, bool numberOnly) { | ||
} | ||
|
||
//% | ||
void cancelTextPrompt() { | ||
} | ||
|
||
//% | ||
ManagedString getTextPromptString() { | ||
return NULL; | ||
} | ||
|
||
//% | ||
int getTextPromptSelectionStart() { | ||
return 0; | ||
} | ||
|
||
//% | ||
int getTextPromptSelectionEnd() { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
/** | ||
* These shims are for enabling system keyboard support in text/number prompts. | ||
*/ | ||
declare namespace helpers { | ||
//% shim=Keyboard::promptForText | ||
function _promptForText(maxLength: number, numbersOnly: boolean): void; | ||
|
||
//% shim=Keyboard::cancelTextPrompt | ||
function _cancelTextPrompt(): void; | ||
|
||
//% shim=Keyboard::getTextPromptString | ||
function _getTextPromptString(): string; | ||
|
||
//% shim=Keyboard::getTextPromptSelectionStart | ||
function _getTextPromptSelectionStart(): number; | ||
|
||
//% shim=Keyboard::getTextPromptSelectionEnd | ||
function _getTextPromptSelectionEnd(): number; | ||
} |