[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Strange .keyDownAction / .keyUpAction behaviour on German Keyboard



Probably you should filter the keypresses so that you syntax colorize on most keystrokes, but not alt-n. Probably would be best to skip colorizing on every alt- keypress. Using the if statement to check the 'modifiers' argument to the key down action function.

hjh


On May 6, 2009, at 8:06 AM, Juan Gabriel Alzate Romero wrote:

Hi all,

I have a problem with the Document.keyDownAction & keyUpAction...
I'm on a german Keyboard. I wanted to do automatic Syntax colorizing with an easy line, and it works (the colorizing) but when I write something it behaves strangely.  This is my biggest problem:


// new document - normal behaviour

alt + n => ~ (highlighted and waits for the next key stroke to put the tilde on it)

alt + n ... space => ~
alt + n ... n => ñ
alt + n ... o => õ



// new document
Document.current.keyDownAction_({ Document.current.syntaxColorize })

// strange: doubles the tilde !!
alt + n ... space => ~~
alt + n ... n =>
alt + n ... o =>



// new document
Document.current.keyUpAction_({ Document.current.syntaxColorize })

// won't be able to write õ, ñ... etc
alt + n => ~ (instantly, doesn't highlight and waits for the next key stroke)



I would like to know if there's another way to make syntax colorizing automatically without having this behaviour.  I need both, the '~' and the 'ñ', so I would be very happy about solving this problem.
Thanks in advance.


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman