RETURN ENTER in Unicode

2014-04-02 Thread Richmond

So; here I am bu**ering around in my Devawriter Pro

[ http://andregarzia.on-rev.com/richmond/dwriterpro.html ]

which is in what I, slightly pompously, call its 3rd System Development
Life-Cycle . . .

Anyway . . .

Inside a socking great rawKeyDown Case statement one of the 
possibilities runs a bit like this:


case 65293
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  
numToChar(10))

select after the selectedText
break

now 65293 is the raw key code for the 'Return' key [ the one above the 
right-hand SHIFT key ],
so, in theory, when an end-user hits that key they should end up with a 
carriage return in the

text field: BUT they don't.

Just to really confuse the issue, when an end-user hits the 'Enter' key 
[ over on the right, on
those keyboards that have a number pad ] they get a carriage return: 
this seems to make
no sense at all considering that the raw key code for the 'Enter' key is 
65421.


So; just for a laugh I threw this into the soup:

case 65421
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  
numToChar(10))

select after the selectedText
break

and that blocked the 'Enter' key as well.

This tells me that my rawKeyDown for those keys is doing sweet FA, and 
merely serving to block

them.

Of course the easy thing to do is just to remove the case 65293 code so 
that the


default
  pass rawKeyDown

at the end of the switch statement just lets the OS strut its funky 
stuff with the 'Return' key

rather than attempting to over-ride it in the app.
-

BUT; this is not entirely satisfying, and I wonder if anyone can tell me 
what I should

have in my case 65293 code instead of

(numToChar(13)  numToChar(10))

to get a carriage return?



LiveCode 4.5 Commercial in Mac OS 10.6.7

---

Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: RETURN ENTER in Unicode

2014-04-02 Thread Devin Asay

On Apr 2, 2014, at 11:18 AM, Richmond richmondmathew...@gmail.com wrote:

 So; here I am bu**ering around in my Devawriter Pro
 
 [ http://andregarzia.on-rev.com/richmond/dwriterpro.html ]
 
 which is in what I, slightly pompously, call its 3rd System Development
 Life-Cycle . . .
 
 Anyway . . .
 
 Inside a socking great rawKeyDown Case statement one of the possibilities 
 runs a bit like this:
 
 case 65293
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  numToChar(10))
select after the selectedText
 break
 
 now 65293 is the raw key code for the 'Return' key [ the one above the 
 right-hand SHIFT key ],
 so, in theory, when an end-user hits that key they should end up with a 
 carriage return in the
 text field: BUT they don't.
 
 Just to really confuse the issue, when an end-user hits the 'Enter' key [ 
 over on the right, on
 those keyboards that have a number pad ] they get a carriage return: this 
 seems to make
 no sense at all considering that the raw key code for the 'Enter' key is 
 65421.
 
 So; just for a laugh I threw this into the soup:
 
 case 65421
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  numToChar(10))
select after the selectedText
 break
 
 and that blocked the 'Enter' key as well.
 
 This tells me that my rawKeyDown for those keys is doing sweet FA, and 
 merely serving to block
 them.
 
 Of course the easy thing to do is just to remove the case 65293 code so that 
 the
 
 default
  pass rawKeyDown
 
 at the end of the switch statement just lets the OS strut its funky stuff 
 with the 'Return' key
 rather than attempting to over-ride it in the app.
 -
 
 BUT; this is not entirely satisfying, and I wonder if anyone can tell me what 
 I should
 have in my case 65293 code instead of
 
 (numToChar(13)  numToChar(10))
 
 to get a carriage return?

Richmond,

LiveCode uses ASCII 10 internally for the end-of-line delimiter. 13+10 is the 
Windows line delimiter, but you should not have to bother with that, unless 
you're saving the text in your field to an external file using put into URL 
binfile:… If you use URL file:… the line-ending conversion happens 
automatically. But I suspect that since you're dealing with unicode text you're 
using bilefile:

Regards,

Devin

Devin Asay
Learn to code with LiveCode University
http://university.livecode.com




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: RETURN ENTER in Unicode

2014-04-02 Thread Richmond

On 02/04/14 20:49, Devin Asay wrote:

On Apr 2, 2014, at 11:18 AM, Richmond richmondmathew...@gmail.com wrote:


So; here I am bu**ering around in my Devawriter Pro

[ http://andregarzia.on-rev.com/richmond/dwriterpro.html ]

which is in what I, slightly pompously, call its 3rd System Development
Life-Cycle . . .

Anyway . . .

Inside a socking great rawKeyDown Case statement one of the possibilities runs 
a bit like this:

case 65293
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  numToChar(10))
select after the selectedText
break

now 65293 is the raw key code for the 'Return' key [ the one above the 
right-hand SHIFT key ],
so, in theory, when an end-user hits that key they should end up with a 
carriage return in the
text field: BUT they don't.

Just to really confuse the issue, when an end-user hits the 'Enter' key [ over 
on the right, on
those keyboards that have a number pad ] they get a carriage return: this seems 
to make
no sense at all considering that the raw key code for the 'Enter' key is 65421.

So; just for a laugh I threw this into the soup:

case 65421
set the useUnicode to true
set the unicodeText of the selectedText to (numToChar(13)  numToChar(10))
select after the selectedText
break

and that blocked the 'Enter' key as well.

This tells me that my rawKeyDown for those keys is doing sweet FA, and merely 
serving to block
them.

Of course the easy thing to do is just to remove the case 65293 code so that the

default
  pass rawKeyDown

at the end of the switch statement just lets the OS strut its funky stuff with 
the 'Return' key
rather than attempting to over-ride it in the app.
-

BUT; this is not entirely satisfying, and I wonder if anyone can tell me what I 
should
have in my case 65293 code instead of

(numToChar(13)  numToChar(10))

to get a carriage return?

Richmond,

LiveCode uses ASCII 10 internally for the end-of-line delimiter. 13+10 is the Windows line 
delimiter, but you should not have to bother with that, unless you're saving the text in your field 
to an external file using put into URL binfile:… If you use URL file:… the 
line-ending conversion happens automatically. But I suspect that since you're dealing with unicode 
text you're using bilefile:

Regards,

Devin




Thank you, Devin,

I just removed the rawKeyDown Case statements to trap the RETURN key, as 
this is

the simplest way to do things.

My Devawriter Preo exports to RTF and HTML; and I have yet to test what 
the output looks like.


Richmond.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode