George TOUBALIS Posted October 23, 2005 Posted October 23, 2005 Hello There... This is my problem: I make A database with keyboard shortcuts Like these: Select All: Ctrl + A Auto Contrast: Ctrl + Alt + Shift + L Guides (show / hide) Ctrl + ; Move Cursor One Word Left/Right: Ctrl + Left Arrow, Right Arrow I have a field "shortcut" with the shortcut text only (Ctrl + A) I want to seperate this field in two Fields: So the Shortcut "Ctrl + Alt + Shift + L" to be Mod Keys: Ctrl + Alt + Shift Kbkey:"L" Or the Shortcut "Ctrl + ;" to be Mod Keys: Ctrl Kbkey:";" All The Short cuts word spaces are : Ctrl &" "& "+" &" "& Alt &" "& "+" &" "& Shift&" "& "+" &" "& Left Arrow any Idea ?
comment Posted October 23, 2005 Posted October 23, 2005 Hi George, Try: ModKeys = Left ( Shortcut ; Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 1 ) KbKey = Right ( Shortcut ; Length ( Shortcut ) - Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 2 )
George TOUBALIS Posted October 23, 2005 Author Posted October 23, 2005 THE CALCULATION ModKeys = Left ( Shortcut ; Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 1 ) work THE CALCULATION KbKey = Right ( Shortcut ; Length ( Shortcut ) - Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 2 ) Not work so I change it to Right ( Shortcut ; Length ( Shortcut ) - Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 1 ) It works fine in all shortcut exept those who has the + (addition) last character For Exable Option + + Do you think that there is an "If" calculation to make... George.... ???
comment Posted October 23, 2005 Posted October 23, 2005 (edited) Ah, the + can be a keyboard press... Try: ModKeys = Case ( Right ( Trim ( Shortcut ) ; 1 ) = "+" ; Left ( Shortcut ; Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) - 1 ) - 2 ) ; Left ( Shortcut ; Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 2 ) ) KbKey = Case ( Right ( Trim ( Shortcut ) ; 1 ) = "+" ; Right ( Shortcut ; Length ( Shortcut ) - Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) - 1 ) - 1 ) ; Right ( Shortcut ; Length ( Shortcut ) - Position ( Shortcut ; "+" ; 1 ; PatternCount ( Shortcut ; "+" ) ) - 1 ) ) Edited October 23, 2005 by Guest Reversed Right() and Trim() in the condition
George TOUBALIS Posted October 23, 2005 Author Posted October 23, 2005 I found Another proplem With these actions all it works fine Select All: Ctrl + A Auto Contrast: Ctrl + Alt + Shift + L Guides (show / hide) Ctrl + ; Move Cursor One Word Left/Right: Ctrl + Left Arrow, Right Arrow But when We Have an actions like Brush Tool: B Pen Tool: P Here we do not have "ModKey" We have Only "Kbkey" and the "Kbkey" after the calculation stays empty.. The correct is to pass the "B" Or the "P" in Kbkey :
George TOUBALIS Posted October 23, 2005 Author Posted October 23, 2005 I found it Case ( Count Letters PC MOD KEY ≤ 2; Shortcut PC WITH SPACES ; Right ( Trim ( Shortcut PC WITH SPACES ) ; 1 ) = "+" ; Right ( Shortcut PC WITH SPACES ; Length ( Shortcut PC WITH SPACES ) - Position ( Shortcut PC WITH SPACES ; "+" ; 1 ; PatternCount ( Shortcut PC WITH SPACES ; "+" ) - 1 ) - 1 ) ; Right (Shortcut PC WITH SPACES; Length ( Shortcut PC WITH SPACES ) - Position (Shortcut PC WITH SPACES ; "+" ; 1 ; PatternCount (Shortcut PC WITH SPACES ; "+" ) ) - 1 ) )
Recommended Posts
This topic is 6970 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now