customizing keyboard shortcuts

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

customizing keyboard shortcuts

Gary Peterson
Hello All,
 
Has anyone customized (added) any keyboard shortcuts?
 
I think it's possible with
 
    initializeDispatchTable
 
using TextConstants, Character, etc.
 
Initially like to add in
 
    Ctrl-Insert
    Shift-Insert
 
which are not on TextConstants/Character so will need to determine their codes...
 
Thank you,   
 
 
 

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Gary Peterson
Turned out to be (my) dumb question; using older reference book. 
 
UIFeelPolicy>>keyboardDispatchTable
 
keyboard bindValue: #copyKey: to: #Insert modifiers: #(control).
keyboard bindValue: #pasteKey: to: #Insert modifiers: #(shift).
Thanks stevek indirectly related June 24 post.
 
Finally, on this end, moving forward ie VW, ie ruby -- from, believe it or not, VSE.
 
Only mystery (curiosity only) is why one bind produces direct-paste and one chooser-paste?
 
keyboard
 bindValue: #pasteKey: to: Ctrlv modifiers: #(#control);
 bindValue: #pasteKey: to: Ctrlv modifiers: #(#control #shift);
 bindValue: #pasteKey: to: #Insert modifiers: #(shift).
 
The first resuts in direct-paste, the last two chooser-type paste?
 
 
 
 
----- Original Message -----
Sent: Friday, October 29, 2010 3:41 PM
Subject: [vwnc] customizing keyboard shortcuts

Hello All,
 
Has anyone customized (added) any keyboard shortcuts?
 
I think it's possible with
 
    initializeDispatchTable
 
using TextConstants, Character, etc.
 
Initially like to add in
 
    Ctrl-Insert
    Shift-Insert
 
which are not on TextConstants/Character so will need to determine their codes...
 
Thank you,   
 
 
 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Steven Kelly
In reply to this post by Gary Peterson
IIRC the #pasteKey: method checks to see if shift is held down, and if so shows the dialog to choose from the VW clipboard history.
 
Steve


From: [hidden email] on behalf of Gary Peterson
Sent: Sun 31/10/2010 19:54
To: [hidden email]
Subject: Re: [vwnc] customizing keyboard shortcuts

Turned out to be (my) dumb question; using older reference book. 
 
UIFeelPolicy>>keyboardDispatchTable
 
keyboard bindValue: #copyKey: to: #Insert modifiers: #(control).
keyboard bindValue: #pasteKey: to: #Insert modifiers: #(shift).
Thanks stevek indirectly related June 24 post.
 
Finally, on this end, moving forward ie VW, ie ruby -- from, believe it or not, VSE.
 
Only mystery (curiosity only) is why one bind produces direct-paste and one chooser-paste?
 
keyboard
 bindValue: #pasteKey: to: Ctrlv modifiers: #(#control);
 bindValue: #pasteKey: to: Ctrlv modifiers: #(#control #shift);
 bindValue: #pasteKey: to: #Insert modifiers: #(shift).
 
The first resuts in direct-paste, the last two chooser-type paste?
 
 
 
 
----- Original Message -----
Sent: Friday, October 29, 2010 3:41 PM
Subject: [vwnc] customizing keyboard shortcuts

Hello All,
 
Has anyone customized (added) any keyboard shortcuts?
 
I think it's possible with
 
    initializeDispatchTable
 
using TextConstants, Character, etc.
 
Initially like to add in
 
    Ctrl-Insert
    Shift-Insert
 
which are not on TextConstants/Character so will need to determine their codes...
 
Thank you,   
 
 
 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Niall Ross
In reply to this post by Gary Peterson
Dear Gary,
    at the risk of pointing out the obvious, have you used the MagicKeys
parcel?

          Yours faithfully
             Niall Ross

>Hello All,
>
>Has anyone customized (added) any keyboard shortcuts?
>
>I think it's possible with
>
>    initializeDispatchTable
>
>using TextConstants, Character, etc.
>
>Initially like to add in
>
>    Ctrl-Insert
>    Shift-Insert
>
>which are not on TextConstants/Character so will need to determine their codes...
>
>Thank you,    
>
>
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>  
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Gary Peterson
Thank you Niall,

I just noticed that goodie (narrative) yesterday -- will try it.

Slowly finding the goodies, etc....

Thank you,

Gary




----- Original Message -----
From: "Niall Ross" <[hidden email]>
To: "Gary Peterson" <[hidden email]>
Cc: <[hidden email]>
Sent: Tuesday, November 02, 2010 7:23 AM
Subject: Re: [vwnc] customizing keyboard shortcuts


> Dear Gary,
>    at the risk of pointing out the obvious, have you used the MagicKeys
> parcel?
>
>          Yours faithfully
>             Niall Ross
>
>>Hello All,
>>
>>Has anyone customized (added) any keyboard shortcuts?
>>
>>I think it's possible with
>>    initializeDispatchTable
>>
>>using TextConstants, Character, etc.
>>
>>Initially like to add in
>>
>>    Ctrl-Insert
>>    Shift-Insert
>>
>>which are not on TextConstants/Character so will need to determine their
>>codes...
>>
>>Thank you,
>>
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>vwnc mailing list
>>[hidden email]
>>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>
>
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Paul Baumann
In reply to this post by Gary Peterson

One way is to use application code that is executed at startup by way of #earlySystemInstallation events.

 

update: aSymbol with: arguments from: anObject

                "Things to do when image status is changing"

                anObject == ObjectMemory

                ifTrue:[

                                "At image startup"

                                (aSymbol == #earlySystemInstallation)  ifTrue:[self initializeKeyBoard]. 

                ...

 

initializeKeyBoard

                InputState interruptKeyValue: -2.            "Ctrl-b"

                ParagraphEditor initialize.

                DispatchTable allInstances do:  [:ea |

                                ea bindValue: #deleteKey: to: Character del.

                                ea bindValue: #acceptKey: to: (Character value: 1).         "Ctrl-a"

                                ea bindValue: #printItKey: to: (Character value: 16).        "Ctrl-p"

                                ea bindValue: #formatKey: to: (Character value: 17).      "Ctrl-q"

                                ea bindValue: #pasteKey: to: (Character value: 22).         "Ctrl-v"

                                ea bindValue: #cutKey: to: (Character value: 24).              "Ctrl-x"

                                ea bindValue: #copyKey: to: (Character value: 3).             "Ctrl-c"

                ].

                TextAttributes initialize.

                VariableSizeTextAttributes initialize.

                InputBoxController initialize.

                InputState doubleClickTimeout: 400

 

 

You can use #bindValue:to:modifiers: to specify actions using modifier keys, or application code can check the modifier keys:

 

                (InputState default ctrlDown and: [InputState default shiftDown])

                                ifTrue: [...]

 

Paul Baumann

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Gary Peterson
Sent: Friday, October 29, 2010 16:42
To: [hidden email]
Subject: [vwnc] customizing keyboard shortcuts

 

Hello All,

 

Has anyone customized (added) any keyboard shortcuts?

 

I think it's possible with

 

    initializeDispatchTable

 

using TextConstants, Character, etc.

 

Initially like to add in

 

    Ctrl-Insert

    Shift-Insert

 

which are not on TextConstants/Character so will need to determine their codes...

 

Thank you,   

 

 

 



This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Alan Knight-2
Why would you do that during earlySystemInstallation? It seems like the biggest effect of that would be that if there was a bug in your code the entire image would be unstartable rather than bringing up a debugger.

At 09:55 AM 2010-11-02, Paul Baumann wrote:
Content-Language: en-US
Content-Type: multipart/alternative;
         boundary="_000_3FCC5C63F3371940900A2160FD399FD3041D6DDCF6atbpixmx02CPE_"

One way is to use application code that is executed at startup by way of #earlySystemInstallation events.
 
update: aSymbol with: arguments from: anObject
                "Things to do when image status is changing"
                anObject == ObjectMemory
                ifTrue:[
                                "At image startup"
                                (aSymbol == #earlySystemInstallation)  ifTrue:[self initializeKeyBoard]. 
                ...
 
initializeKeyBoard
                InputState interruptKeyValue: -2.            "Ctrl-b"
                ParagraphEditor initialize.
                DispatchTable allInstances do:  [:ea |
                                ea bindValue: #deleteKey: to: Character del.
                                ea bindValue: #acceptKey: to: (Character value: 1).         "Ctrl-a"
                                ea bindValue: #printItKey: to: (Character value: 16).        "Ctrl-p"
                                ea bindValue: #formatKey: to: (Character value: 17).      "Ctrl-q"
                                ea bindValue: #pasteKey: to: (Character value: 22).         "Ctrl-v"
                                ea bindValue: #cutKey: to: (Character value: 24).              "Ctrl-x"
                                ea bindValue: #copyKey: to: (Character value: 3).             "Ctrl-c"
                ].
                TextAttributes initialize.
                VariableSizeTextAttributes initialize.
                InputBoxController initialize.
                InputState doubleClickTimeout: 400
 
 
You can use #bindValue:to:modifiers: to specify actions using modifier keys, or application code can check the modifier keys:
 
                (InputState default ctrlDown and: [InputState default shiftDown])
                                ifTrue: [...]
 
Paul Baumann
 
 
 
From: [hidden email] [[hidden email]] On Behalf Of Gary Peterson
Sent: Friday, October 29, 2010 16:42
To: [hidden email]
Subject: [vwnc] customizing keyboard shortcuts
 
Hello All,
 
Has anyone customized (added) any keyboard shortcuts?
 
I think it's possible with
 
    initializeDispatchTable
 
using TextConstants, Character, etc.
 
Initially like to add in
 
    Ctrl-Insert
    Shift-Insert
 
which are not on TextConstants/Character so will need to determine their codes...
 
Thank you,   
 
 
 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Paul Baumann

It is legacy code.  I guess we are just fortunate there have been no bugs in it. I'm glad there are better ways.

 

From: Alan Knight [mailto:[hidden email]]
Sent: Tuesday, November 02, 2010 11:56
To: Paul Baumann; Gary Peterson; [hidden email]
Subject: Re: [vwnc] customizing keyboard shortcuts
Importance: High

 

Why would you do that during earlySystemInstallation? It seems like the biggest effect of that would be that if there was a bug in your code the entire image would be unstartable rather than bringing up a debugger.



This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: customizing keyboard shortcuts

Paul Baumann

I just looked into that code a little more. The code I showed was cut down from the original, and I cut out an important part without looking at it. The code actually used sends #atStartup from the system event, and the #atStartup method does the initialization. The important thing I cut out was that #atStartup has a fork to avoid the P100 process set by #preSnapshot. That is how the code avoids the problems that Alan mentioned. Good catch Alan. I'd forgotten about the workaround to avoid the P100 startup. That workaround is as recent as 2006 so that the application process we launch isn't also at P100.

 

atStartup

                "On image startup restart the ORB, and a server"

                [

                | win |

                Processor yield. "Yield to other image startup activities"

                win := Window popUpAtActiveWindowWith: ' Initializing...  Please wait. ' asComposedText.

                ...

                self initializeKeyBoard.

                ...

                win close.

                ]

                                forkAt: Processor userSchedulingPriority.             "Avoid P100 activePriority set by #preSnapshot"

 

Why do it at startup? I suspect it is just so the key definitions are effective early in a runtime image start.

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Paul Baumann
Sent: Tuesday, November 02, 2010 12:05
To: Alan Knight; Gary Peterson; [hidden email]
Subject: Re: [vwnc] customizing keyboard shortcuts

 

It is legacy code.  I guess we are just fortunate there have been no bugs in it. I'm glad there are better ways.

 

From: Alan Knight [mailto:[hidden email]]
Sent: Tuesday, November 02, 2010 11:56
To: Paul Baumann; Gary Peterson; [hidden email]
Subject: Re: [vwnc] customizing keyboard shortcuts
Importance: High

 

Why would you do that during earlySystemInstallation? It seems like the biggest effect of that would be that if there was a bug in your code the entire image would be unstartable rather than bringing up a debugger.

 


This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.



This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc