Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » how to catch CodeEditor keys?
how to catch CodeEditor keys? [message #47894] Wed, 19 April 2017 18:22 Go to next message
luoganda is currently offline  luoganda
Messages: 194
Registered: November 2016
Experienced Member
default subclassing,eg:
virtual bool Key(dword key,int count){
  return CodeEditor::Key(key,count);
}

doesn't seem to work-it's not called, or am i missing something?
for now i am using some hokus-pokus...

By the way, is there an easy way to convert key characters<65536 into virtualKeyCode,
so that Shift/Ctrl/Alt can be used/known independently - eg, when 2 is pressed to check if Shift was pressed too?
like Ctrl-2 or Shift-2, some kind of translation table or something?

[Updated on: Wed, 19 April 2017 18:38]

Report message to a moderator

Re: how to catch CodeEditor keys? [message #48337 is a reply to message #47894] Sat, 24 June 2017 15:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
luoganda wrote on Wed, 19 April 2017 18:22
default subclassing,eg:
virtual bool Key(dword key,int count){
  return CodeEditor::Key(key,count);
}



This looks fine. If it does not get called, problem is probably elsewhere. Testcase would help to identify it.

Quote:

By the way, is there an easy way to convert key characters<65536 into virtualKeyCode,
so that Shift/Ctrl/Alt can be used/known independently - eg, when 2 is pressed to check if Shift was pressed too?
like Ctrl-2 or Shift-2, some kind of translation table or something?

[/quote]

Not sure if that will answer your question, but you can definitely use e.g. K_SHIFT|K_2.

Maybe the confusing part is that Key recieves both 'translated characters' and 'key codes'. So if user presses '2', Key gets K_2 and and '2' (order is not specified).
Re: how to catch CodeEditor keys? [message #48392 is a reply to message #48337] Thu, 29 June 2017 17:19 Go to previous messageGo to next message
luoganda is currently offline  luoganda
Messages: 194
Registered: November 2016
Experienced Member
I'm not into this right now, but:

1)>>
Default subclassing:
  this is probably more or less because i'm inserting 'layout' window into layout window,
  is there an easy way to use this, so default subclassing works as expected?

2)>>
It turned out it was easier to use like it is,without any translation tables - just directly(if keyCh<65536...),
  but that 'keys used independently' may come handy sometimes,
  aha, for confusing part and K_SHIFT|K_2
Re: how to catch CodeEditor keys? [message #48398 is a reply to message #48392] Fri, 30 June 2017 14:00 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
luoganda wrote on Thu, 29 June 2017 17:19
[pre]
I'm not into this right now, but:

1)>>
Default subclassing:
this is probably more or less because i'm inserting 'layout' window into layout window,
is there an easy way to use this, so default subclassing works as expected?


Maybe your key is processed by some widget?

Mirek
Previous Topic: WithDropChoice has Get,GetCount, but no Set,Remove
Next Topic: How to handle copy & paste with focus changing
Goto Forum:
  


Current Time: Thu Apr 18 10:32:02 CEST 2024

Total time taken to generate the page: 0.02436 seconds