r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Maxim
29-Nov-2006
[6262x3]
anyone have a fast  recipe to convert an integer into a tupple?
the complement to:
>> to-integer to-binary 0.2.1
== 513
(sorry that's tuple!)
Anton
29-Nov-2006
[6265]
almost:
>> to-tuple third make struct! [int [int]][513]
== 1.2.0.0
Maxim
29-Nov-2006
[6266x3]
>> to-tuple next reverse third make struct! [int [int]][513]
== 0.2.1
not very REBOLish though  :-(
thanks... I'll wrap that in a func.
JaimeVargas
29-Nov-2006
[6269x2]
rebolish, but I don't know if pretty
to-tuple debase/base skip to-hex 513 2 16
Jerry
3-Dec-2006
[6271]
I am trying to make a component which accepts key events and draws 
something on the its face, such as musical notes and  phonetic symbol. 
To accept the key events, the system/view/focal-face has to point 
to the component and system/view/caret has to point to the text in 
the component. The problem is ... I don't want to show the caret. 
It's useless and weird in this case. Is there any way that I can 
hide the caret and still keep my component key-aware. Thank you.
Henrik
3-Dec-2006
[6272]
focus/no-show ?
Gabriele
3-Dec-2006
[6273x2]
i think there was a hack to do that, iirc you can set the caret to 
a string different than face/text or something like that.
otherwise, you need to intercept keys with detect and "simulate" 
focus on your own.
Volker
3-Dec-2006
[6275x2]
setting the caret to none works.
after focussing.
Jerry
3-Dec-2006
[6277]
Thank you, Henrik, Gabriele, and Volker
Jerry
4-Dec-2006
[6278]
Since REBOL/View doesn't support Unicode or Big-5, I am trying to 
make an Input Method Editor (IME) by myself. For typing in Chinese/Japanese/Korean 
text, you need a IME to detect the key inputs and combine them into 
C/J/K characters. I've collected more then 50,000 Chinese characters, 
their bitmap and combination. This only thing I have not done yet 
is the key mapping. For that, I did a little experience, and realized 
that there are some keys REBOL/View cannot detect.


1. F10. REBOL/view detects F1 to F9, even F11 and F12, ... but not 
F10. Why?

2. DELETE as a word!, not char!. Because INSERT is detected as a 
word!, maybe DELETE should be of the same type.

3. CapsLock and NumLock. I whish we could not only detect them when 
pressed, but also query their status anytime we want to know.
4. Shift-down, Shift-Up, Ctrl-down, Ctrl-Up, Alt-down, Alt-up
Gabriele
4-Dec-2006
[6279x2]
insert is a word because there is no char for it in ascii; there 
is a char for delete, so it's a char :)
you should be able to decect shift-up etc, by checking event/shift 
and event/ctrl. if not, maybe there's a bug.
Gregg
4-Dec-2006
[6281]
I think F10 isprobably because that maps to WM_MENU, so WIndows is 
eating it. For cap/num-lock, you should be able to do that with the 
GetKeyState and GetAsyncKeyState APIs. It is a bit of a shortcoming 
that we only get keypress events, not keyup/keydown as well (if we 
want them anyway).  I can understand the logic, that you won't need 
them in most simple apps, but a lot of people are doing stuff with 
REBOL where they would definitely help.
Graham
4-Dec-2006
[6282]
What's the GetKeyState and GetAsyncKeyState Api ?
Gregg
4-Dec-2006
[6283]
From MSDN: 


The GetKeyState function retrieves the status of the specified virtual 
key. The status specifies whether the key is up, down, or toggled 
(on, off—alternating each time the key is pressed). 


The key status returned from this function changes as a thread reads 
key messages from its message queue. The status does not reflect 
the interrupt-level state associated with the hardware. Use the GetAsyncKeyState 
function to retrieve that information. 


An application calls GetKeyState in response to a keyboard-input 
message. This function retrieves the state of the key when the input 
message was generated. 


To retrieve state information for all the virtual keys, use the GetKeyboardState 
function. 


An application can use the virtual-key code constants VK_SHIFT, VK_CONTROL, 
and VK_MENU as values for the nVirtKey parameter. This gives the 
status of the SHIFT, CTRL, or ALT keys without distinguishing between 
left and right. An application can also use the following virtual-key 
code constants as values for nVirtKey to distinguish between the 
left and right instances of those keys.
Jerry
4-Dec-2006
[6284x2]
Gregg, I cannot use the Windows Native APIs. I hope the script is 
portable. I hope that it can run on MacOS, too.
Thank you Gabriele. the event/control and event/shift work.
Gregg
5-Dec-2006
[6286]
For portability APIs aren't the easiest way to go. I'm not a *nix 
guy, so I don't know what the solution would be there.
Maxim
5-Dec-2006
[6287x4]
this is the exact discussion I was having with Anton a few weeks 
ago... although we can sometimes get to such stuff..  its a pain, 
and in some cases, its not even possible for some events... and then 
one has to wonder how to get to them on platforms they know nothing 
about.
I really do hope a better  HAL API for handling more events is devised 
for R3.
and Gregg, key ups are as usefull for low-level implementations of 
UIs as mouse ups.  Wonder why there are so few VIEW games?
REBOL promises so much, then feels deceptively shallow at times. 
 That doesn't meen I give up... it just means I'm relatively alone 
in my club.  :-(
Gregg
5-Dec-2006
[6291]
This is where I distinguish between REBOL the language, and the things 
built on top of it, like View. REBOL is great, but some of the supporting 
pieces need to be improved.
Jerry
5-Dec-2006
[6292]
I gotta tell you. Implementing an IME and showing Chinese characters 
on REBOL/View are perplexing and painful, especially I am doing this 
all by myself. Even worse, considering I have so many works to do 
in my office, I don't really have much time to do this for REBOL/View. 
But I want it so bad, what options do I have? Waiting for REBOL 3.0 
or 3.1? Well, I look forward to it, but I don't count on it. Only 
God knows when it's going to be released. 


As a "Messaging Language" for communication between people and people, 
computers and people, computers and computers, REBOL should have 
supported I18N many years ago.
Graham
5-Dec-2006
[6293x4]
We know.
How is it going so far Jerry?
Got anything to show?
Have you seen that french application that teaches Chinese characters 
?
Jerry
5-Dec-2006
[6297x2]
It's not going any far (if I know where I am going), since I am stuck 
in IME. There are some decisions to make. I've just started to think 
that maybe the whole IME thing is a stupid idea. Every morning, I 
wake up and turn on the computer, hoping that the REBOL 3.0 alpha 
is out and end my misery. "Unicode support is not released today. 
Well, it could be tomorrow. Everything is gonna be different tomorrow." 
Since 5 years ago, I keep telling myself the same thing.
French application that teachs Chinese characters?
Graham
5-Dec-2006
[6299]
Yeah.
Jerry
5-Dec-2006
[6300]
http://www.xuehanyu.org/this one?
Graham
5-Dec-2006
[6301x3]
Yes.
It's a view application ...
somewhere ...
Jerry
5-Dec-2006
[6304]
Well, the Chinese Characters in that web site are images.
Graham
5-Dec-2006
[6305x2]
they have two interfaces ...
http://www.xuehanyu.org/sinoglyph.html
Jerry
5-Dec-2006
[6307x2]
It's simplified Chinese used in China, not in Hongkong and Taiwan. 
This is a good site though.
It's too bad I cannot read French.
Graham
5-Dec-2006
[6309]
Looks like they removed the source code link.
Jerry
5-Dec-2006
[6310]
Well, that's ok. Thank you Graham. BTW, are you Chinese? You have 
a Chinese last name.
Graham
5-Dec-2006
[6311]
Yes.