Bug 289752 - Bidi: Ctrl+RightShift/Ctrl+LeftShift doesn't switch the StyledText orientation
Summary: Bidi: Ctrl+RightShift/Ctrl+LeftShift doesn't switch the StyledText orientation
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.6 M3   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 143911
Blocks:
  Show dependency tree
 
Reported: 2009-09-17 11:04 EDT by Shensis Alexander CLA
Modified: 2009-10-12 11:54 EDT (History)
6 users (show)

See Also:


Attachments
patch (1.44 KB, patch)
2009-10-02 14:11 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shensis Alexander CLA 2009-09-17 11:04:41 EDT
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
Build Identifier: any

On Windows platform one is able to change System Editor's (and not only) orientation by pressing Ctrl+RightShift/Ctrl+LeftShift.

SWT Text widget due to being implemented by platform editor, sticks to this behaviour.

Unfortunately SWT StyledText doesn't respect these (or any other) hot key combination, thus impeding its usability for Arabic/Hebrew customers.

It worth noting in this context that eclipse Text Editor did respect these feature prior to year 2003 but such behaviour was complained after under defect 165089.

Eclipse Text Editor is basd on SWT StyledText indeed, however even if the discussed behaviour has been desided to be disoraged for Text Editor, it still highly important to StyledText, on Bidi systems (i.e. system having Arabic or Hebrew keyboard installed).

We are willing to contribute the code backing up discussed functionality.

Reproducible: Always

Steps to Reproduce:
1. Run SWT application having StyledText widget.
2. Press  Ctrl+RightShift.
3. Result: Nothing happens in sense that widget's orientation doesn't chagne
Comment 1 Felipe Heidrich CLA 2009-09-21 15:09:01 EDT
IMO StyledText doesn't need to offer this behaviour. Most clients do not want switch orientation on Ctrl+Shift.

Once bug 143911 is fixed, the application will be able to implement this behaviour easily using the StyledText#setOrientation(int) API.

Note: only windows xp with support for left-to-right installed or windows vista with Arabic or Hebrew keyboard layout install present the behaviour described in comment 0.
Comment 2 Shensis Alexander CLA 2009-09-22 07:41:00 EDT
The last remark isn't correct.
The discussed behaviour is supported for all localized Windows OS's and by virtually all editors (not only by system editor but also by MS Word for instance). The Arabic/Hebrew customers are largely dependant on such feature.
Comment 3 Felipe Heidrich CLA 2009-09-22 08:56:19 EDT
(In reply to comment #2)
> The last remark isn't correct.

You missed the point.

We agree that:
- This behaviour is very important for bidi users
- Non-bidi users do not want this behaviour 

We need a rule for when to enable the behaviour.
BidiUtil#isBidiPlatform()
is the best match we have right now, but I don't want to tell people to use BidiUtil as I want to get rid of it.
Comment 4 Felipe Heidrich CLA 2009-10-02 14:11:01 EDT
Created attachment 148674 [details]
patch
Comment 5 Felipe Heidrich CLA 2009-10-02 14:21:05 EDT
With the patch StyledText will switch orientation to:
left-to-right when ctrl + left_shift is pressed
right-to-left when ctrl + right_shift is pressed

The action only occurs during the key up of the the shift key if:
- it is bidi platform (BidiUtil.isBidiPlatform()==true, win32 only)

- there was no other keystroke between the keydown and the keyup of the shift key. that is important to not break any ctrl+shift+letter keybinding.

The native text widget in windows follows the same rules.


Dani, are you okay with this behaviour. Do you think editors will need to be  able to stop this behaviour ?
Comment 6 Dani Megert CLA 2009-10-05 08:15:48 EDT
>Dani, are you okay with this behaviour. Do you think editors will need to be 
>able to stop this behaviour ?
I only see a problem for users that assign 'Ctrl+Shift' to a hover. Out of the box we don't do this, so I guess it's OK. We can add API to stop this if we detect a problem in the future.
Comment 7 Felipe Heidrich CLA 2009-10-05 13:59:51 EDT
Okay, thanks Dani.

Fixed in HEAD > 20091005
Comment 8 Markus Keller CLA 2009-10-09 14:56:43 EDT
I've filed bug 291949 and bug 291950 for text and Java editors. We likely need support to listen and veto direction changes.
Comment 9 Dani Megert CLA 2009-10-12 11:54:21 EDT
>We likely need support to listen and veto direction changes.
Agree, this would be good in order to change the direction for all widgets inside the editor. Filed bug 292056 to track this.