Currently, I am facing an interesting challenge while attempting to make my Pebble watch recognize the escape sequence character \t
when sending data to my watch using SimplyJS.
Here is the code snippet I have been working with:
simply.scrollable(true);
simply.style('small');
simply.fullscreen(true);
var aflLadderUrl = 'http://www.sportal.com.au/feeds/sss/afl_ladder.json';
var ladderContent = '';
ajax({ url: aflLadderUrl, type: 'json'},
function(data) {
var i = 0;
while (i < 18){
ladderContent = ladderContent + data.ladder[i].friendly_name + '\t\t\t' + data.ladder[i].percentage + '\n';
i++;
}
simply.text({
title: 'AFL Ladder',
body: ladderContent
});
},
function() {
simply.text({
title: 'AFL Ladder',
body: 'No internet connection'
});
}
);
The issue I am currently encountering is that the \n
seems to work fine as each row of data appears on a separate line on my watch. However, it seems like the \t
escape sequence is not recognized and instead of inserting a tab into my line, no whitespace is displayed (for example, 'my name is' + '\t\t\t' + 'dave'
is shown as my name isdave
).
I also tried creating a basic Hello World program using just the Pebble SDK from https://github.com/kristofvc/pebble-hello-world/blob/master/src/pebble_hello_world.c and added some \t\t
in the string to be printed on line 11. It became apparent that the SDK recognizes \n
characters but not \t
characters (similar to my experience with the SimplyJS app).
My query is: Is there a way for the Pebble (through the SDK or SimplyJS) to display tabs in the same manner as expected when printing to a console? While I understand that the \t character may not be fully supported and substituting it with spaces could be a workaround, this particular scenario intrigued me.
Please feel free to request more information if needed.
Thank you in advance!