1. Andrzej Kubacka
  2. PowerBuilder
  3. Wednesday, 10 February 2021 14:07 PM UTC

Hello!


I have a problem with the RTE editor and RichText edit style in a datawindow. When I type alt(right)-z every time is triggered Undo. Is the solution for blocking this combination of keys. In Polish, in the national character set there is an alt-z character (letter ż). To test this problem, you need to change the keyboard type to Polish. This is independent of the operating system version. I am using PB 2019 R2 on Windows 7 and 10 64 bit operating system.

Regards.

 

 

Andrzej Kubacka Accepted Answer Pending Moderation
  1. Thursday, 11 February 2021 13:28 PM UTC
  2. PowerBuilder
  3. # 1
Thanks for your suggestion. I tested the suggested solution but unfortunately it doesn't work. (Right alt + Z) AltGr-Z is not called at all in pbm_renkey in TichTextEdit.
Comment
  1. Miguel Leeuwe
  2. Thursday, 11 February 2021 17:44 PM UTC
No, the AltGr combination was just an observation.

Your best chance is to create a bug / support ticket.

regards.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 11 February 2021 12:35 PM UTC
  2. PowerBuilder
  3. # 2

I also had problems with Richtext edit checking on keys.

This works, (make sure you don't have any menu in which you have a shortcut for ALT+Z):

if keydown(keyalt!) and keydown(keyz!) then
	post messagebox('debug', "cancelled")
	return 1
end if
return 0

This also works:

if keyflags = 4 and key = Keyz! then
	post messagebox('debug1', "cancelled")
	return 1
end if

return 0

This does NOT work:

// keyflags ...
// 1 = SHIFT
// 2 = CTRL
// 2 = AltGR (like ctrl!!)
// 3 = should be SHIFT+CTRL but does not work !!
// 4 = ALT (undocumented in PB help)

// nevertheless, this should work, but it doesn't:
if keyflags = 4 then
	if key = Keyz! then
		post messagebox('debug', "cancelled")
		return 1
	end if
end if
return 0

Hope it works, this is using the v15 version of the TX text control in PB 2019 R3

regards.

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 11 February 2021 00:12 AM UTC
  2. PowerBuilder
  3. # 3

Nothing happens with Alt+Z on mine, but with AltGr ...

If I use the v15.0 version and I type "abcde" and then do AltGr+z,the whole text disappears (English windows and settings).

If I use the v28.0 version, same thing happens. AltGr+z seems to clear the whole contents. (Not too worried about that a user would do that though).

 

Comment
  1. Miguel Leeuwe
  2. Thursday, 11 February 2021 02:12 AM UTC
Lol, 1 hand 2 fingers
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 11 February 2021 03:33 AM UTC
:-D Not as bad as I imagined!
  1. Helpful
  1. Andrzej Kubacka
  2. Thursday, 11 February 2021 11:50 AM UTC
Thank you for your interest in the topic. In this case, the main point is that after pressing Alt-Z the undo operation should not be performed, and the text should not disappear. After the alt-z key combination, one of the letters of the Polish alphabet is entered, as a result it cannot be used.

Andrzej
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 21:55 PM UTC
  2. PowerBuilder
  3. # 4

One workaround may be to capture the keystroke ALT-Z and replace it with a command that works in the RTE object ~OR~ simply do nothing. It's better than the UNDO.

Olan

Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 10 February 2021 22:44 PM UTC
Thanks for the suggestion Olan!
  1. Helpful
  1. Andrzej Kubacka
  2. Thursday, 11 February 2021 11:15 AM UTC
In old version of PB i captured the key in richtextedit:

IF in_PowerBuilder_version = PB_VERSION_10_2 THEN

IF KeyDown( KeyAlt! ) THEN



IF KeyDown( KeyA! ) OR &

KeyDown( KeyC! ) OR &

KeyDown( KeyE! ) OR &

KeyDown( KeyN! ) OR &

KeyDown( KeyL! ) OR &

KeyDown( KeyO! ) OR &

KeyDown( KeyZ! ) OR &

KeyDown( KeyX! ) THEN





RETURN 1

END IF

END IF

END IF

RETURN 0



In newest version of richtextedit key capture does not work. How do this in pb 2019?



  1. Helpful
  1. Miguel Leeuwe
  2. Friday, 12 February 2021 12:38 PM UTC
You have to put both keydown() in a SINGLE if statement, then it works:

if keydown(keyAlt) and keydown(keyZ!) then

.....

end if

  1. Helpful
There are no comments made yet.
Andrzej Kubacka Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 20:18 PM UTC
  2. PowerBuilder
  3. # 5
A similar problem exists in the PowerBuilder IDE in all versions. When typing the Polish letter "ż" (Alt-z), the previously entered character is deleted. Years later, Polish programmers learned to handle the problem by typing a space before putting "ż" (Alt-z).

I hope that this bug will be fixed relatively quickly, especially in the RTE editor. I will open the support ticket with this bug.

 

Regards

Comment
There are no comments made yet.
Andrzej Kubacka Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 18:58 PM UTC
  2. PowerBuilder
  3. # 6
I am using Built-in TX Text Control. 
Alt-z problem occurs on all windows 10 and windows 7 computers.
Comment
  1. Armeen Mazda @Appeon
  2. Wednesday, 10 February 2021 19:03 PM UTC
This sounds like Polish is not supported by this RichTextEditor and the documentation did not make this clear, but it is possible it is a bug. Regardless, I recommend opening a support ticket so that we can either fix the documentation or the bug. https://www.appeon.com/standardsupport/newbug
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 February 2021 14:29 PM UTC
  2. PowerBuilder
  3. # 7

Which RichText option are you using?

can you reproduce same problem on a Windows 10 machine?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.