1 страниц (6 вхождений)
SMath Keyboard Shortcuts - Comparing Keystroke Commands and Key Bindings of SMath v0.99 against Mathcad 15.0 - Сообщения
#1 Опубликовано: 14.12.2022 20:45:23
Greetings!
Information pertaining to Keyboard Shortcuts is scattered across the WIKI, the Forums, Interactive Handbooks, and SMath Tutorial PDFs. While it is possible for seasoned SMath users to find this data, tracking down a list of keyboard shortcuts can be a daunting task for new users. In addition, it is common for new users to migrate to SMath from Mathcad 15.0, but a sided-by-side comparison of keyboard commands is nowhere to be found.
With these thoughts in mind, I compiled the following 6-paged PDF:
[v0.99] SMath Keyboard Shortcuts.pdf (592 КиБ) скачан 660 раз(а). Dated: 2022-12-09
Some of this data will be outdated as v1.00 has been released, but most of these keypresses should still hold true. If you discover an error (or would like to mention an additional command/action), please post a reply.
May this be of Good Help;
- Kenny Lemens, P.E. ᵂᴵ
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
List of Sources:
Information pertaining to Keyboard Shortcuts is scattered across the WIKI, the Forums, Interactive Handbooks, and SMath Tutorial PDFs. While it is possible for seasoned SMath users to find this data, tracking down a list of keyboard shortcuts can be a daunting task for new users. In addition, it is common for new users to migrate to SMath from Mathcad 15.0, but a sided-by-side comparison of keyboard commands is nowhere to be found.
With these thoughts in mind, I compiled the following 6-paged PDF:
[v0.99] SMath Keyboard Shortcuts.pdf (592 КиБ) скачан 660 раз(а). Dated: 2022-12-09
Some of this data will be outdated as v1.00 has been released, but most of these keypresses should still hold true. If you discover an error (or would like to mention an additional command/action), please post a reply.
May this be of Good Help;
- Kenny Lemens, P.E. ᵂᴵ
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
List of Sources:
- UNITS/FUNCTIONS/HOTKEYS (Version 0.95; Last Modified: 2012/09/02):
- https://smath.com/wiki/GetFile.aspx?File=forum_attach/TheWizEd/SMathLib_095.pdf
- KEYBOARD SHORTCUTS (Incomplete List; Last Modified: 2011/08/05):
- https://en.smath.com/wiki/Keyboard%20shortcuts.ashx
- INTERACTIVE HANDBOOK: https://en.smath.com/view/interactivebook/ (released at 2018/10/03):
- NOTE: Can be installed via the [Plugin...] Extensions Manager --> Interactive Books; located within SMath
- https://en.smath.com/forum/yaf_postst13872_Interactive-Handbook.aspx
- Operators and their keyboard input 「Cheat.sm」
- Greek Characters 「Greek Characters.sm」
- Key bindings (German keyboard layout) 「German key bindings.sm」
- Background information on operators 「Section math operators basics.sm」
- Operators and their keyboard input 「Cheat.sm」
- NOTE: Can be installed via the [Plugin...] Extensions Manager --> Interactive Books; located within SMath
- Mathcad 15.0 Keyboard Shortcuts
- (contains broken images) https://paul-k.net/tty/mathcad_keyboard_shortcuts/
- (Filepath if Mathcad is installed: file:///C:/Program%20Files%20(x86)/Mathcad/Mathcad%2015/Resource%20Center/EN/Keyboard/Keyboard_shortcuts.html
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
6 пользователям понравился этот пост
João Felipe Seráfico Melo 14.12.2022 22:05:00, Mark R Harris 15.12.2022 03:18:00, Davide Carpi 15.12.2022 06:26:00, sergio 15.12.2022 07:20:00, Alvaro Diaz Falconi 15.12.2022 14:58:00, German 05.04.2023 11:39:00
#2 Опубликовано: 15.12.2022 07:25:22
An opportunity (however often happens in this forum) in which the "thanks" must be written for extensive
sergio
sergio
#3 Опубликовано: 15.12.2022 07:38:35
Thanks for the compilation.
I bookmark your post as a remainder for the next update of my german handbook , which has two sections dedicated to operator input and key bindings (Appendix B and C).
I bookmark your post as a remainder for the next update of my german handbook , which has two sections dedicated to operator input and key bindings (Appendix B and C).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
⚜ Kenny Lemens, P.E. ᵂᴵ 15.12.2022 11:09:00
#4 Опубликовано: 15.12.2022 09:26:28
1 пользователям понравился этот пост
⚜ Kenny Lemens, P.E. ᵂᴵ 20.03.2025 04:18:00
#5 Опубликовано: 15.12.2022 16:56:54
Salutations!
If you are used to Mathcad 15.0, you will have difficulty Creating/Navigating a worksheet because SMath has limited support when it comes to hotkeys/keyboard operations. SMath requires a fair amount of operations to be achieved via the mouse [🖰], which can be annoying (and time consuming) if you wish to type a lot of math/text quickly.
Whereas I did identify some remedies/workarounds (i.e., insert ▮⊕▮ (xor Operator) via HEX code 00A4 [Currency sign symbol: ¤]), this remains a work-around and does not actually address the issue. Therefore, I developed the following code:
'VB.net - Framework 2.0; Windows 10 Pro x64; SMath 0.99.7822.147 [English, USA]
keybinding_with_IPluginMenuExtender.vb.txt (37 КиБ) скачан 72 раз(а).
Preview:

Q: ) Will you be deploying this as a SMath Extension?
A: ) No, I do not plan to. As to why, the reason is simple: I do not know how this plugin will behave across different languages/keyboard configurations/operating systems. Before I could release a plugin I am proud of, I would need to address the implications that will result from these different configurations. In addition, such a plugin would beg the developer to permit users to customize key bindings to any given action; I do not have the time to develop such a great utility. Finally: such a plugin has the dangers of being greedy; I would not be able to guarantee such a plugin to respect (either by yielding or overtaking) keystrokes reserved by any given plugin.
Q: ) Why is this code written in Visual Basic and not C++
A: ) VB.net is not the better language, but rather I cannot ignore the benefits of VB within my profession. It is easy to read, less prone to make syntax errors, has a large range of implementations from VBScript in Mathcad, to VBA in MSOffice, from VB6 to VB.net in VSTO/Desktop applications. With that being said, I will not be posting the C++ equivalent as I am not proficient in doing so; I apologize for the inconvenience.
With that being said, here are some of my 'lessons learned' during my research:
May this be of Good Help, Merry Christmas;
- Kenny Lemens, P.E. ᵂᴵ
If you are used to Mathcad 15.0, you will have difficulty Creating/Navigating a worksheet because SMath has limited support when it comes to hotkeys/keyboard operations. SMath requires a fair amount of operations to be achieved via the mouse [🖰], which can be annoying (and time consuming) if you wish to type a lot of math/text quickly.
Whereas I did identify some remedies/workarounds (i.e., insert ▮⊕▮ (xor Operator) via HEX code 00A4 [Currency sign symbol: ¤]), this remains a work-around and does not actually address the issue. Therefore, I developed the following code:
'VB.net - Framework 2.0; Windows 10 Pro x64; SMath 0.99.7822.147 [English, USA]
keybinding_with_IPluginMenuExtender.vb.txt (37 КиБ) скачан 72 раз(а).
Document is uploaded as a (*.txt), remove extension for file to be treated as a VB class (*.vb ): Please practice good judgment before downloading and opening any executable files!
Code will compile, you may copy/paste the following into your project:
Code will compile, you may copy/paste the following into your project:
Imports SMath.Manager
Imports SMath.Controls
Public Class FormControl_4a_Implementer : Implements IPluginMenuExtender
Private disposedValue As Boolean 'Generated by Default
Public Sub Initialize() Implements IPlugin.Initialize
'Throw New NotImplementedException() 'Generated by Default; Comment out/delete for plugin to execute
End Sub
Public Const CURSOR_STEP As Integer = 10 'Number of pixels to move cursor; referenced by: (btnKeyPress11 .. btnKeyPress15)
'''==============================================================================================
''' <name>GetMenuItem</name>
''' <author>Kenneth M. Lemens (username: lemensk)</author>
''' <date>2022-12-15</date>
''' <type>IPluginMenuExtender</type>
''' <summary>Adds MenuButtons to the Menu Bar
''' MenuButtons are assigned Shortcut keys, to be used within a document (regions need not be selected)
''' Shortcut keys to Mimic some Mathcad 15.0 Keypresses, enhances ability to insert operators within SMath
''' MENU BAR BUTTON LAYOUT:
''' [Tools]
''' [Keyboard Extension]
''' - 「Ctrl」+「%」 :: Boolean XOR (Exclusive or)
''' - 「Ctrl」+「!」 :: Boolean NOT
''' - 「Ctrl」+「-」 :: Insert a Macron (bar) Above the Previous Character
''' - 「Ctrl」+「_」 :: Insert a Macron Below (undlerline) Above Previous Character
''' - 「Ctrl」+「+」numpad :: Plus Minus Sign (Returns a set of 2: the sum And difference)
''' - 「Ctrl」+「-」numpad :: Minus Plus Sign (Returns a set of 2: the difference And sum)
''' - 「Ctrl」+「~」 :: Approximately Equal to (「Ctrl」+「Alt」+「=」)
''' - 「Ctrl」+「Shift」+「~」 :: Approximately NOT Equal to
''' - 「Ctrl」+「;」 :: Range variable [a .. b] (step = 1)
''' - 「Ctrl」+「4」 :: Vector sum
''' - 「Ctrl」+「Shift」+「Enter」 :: Move ✛ to Start of Next Line (Line Feed & Carriage Return Only) "Ignore Region Interaction" Mode --- DocumentPointer - Line Feed [↩]
''' - 「Ctrl」+[↓] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [↓]
''' - 「Ctrl」+[←] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [←]
''' - 「Ctrl」+[→] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [→]
''' - 「Ctrl」+[↑] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [↑]
''' </summary>
''' <param name="_profileOfSession">(byRef) SMath.Manager.SessionProfile (Not Utilized)</param>
''' <returns>TYPE: MenuButton() - List of MenuButtons) </returns>
''' <remarks>
''' Imports: SMath.Manager; SMath.Controls
''' Implements: SMath.Controls.IPluginMenuExtender
''' References: KEY CODES for "ShortcutKey" property (NOTE: Operator 'Or' does not serve as a boolean operator)
''' https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.keys?view=windowsdesktop-7.0
''' Unstructured Exit: FALSE
''' Error Handler: TRUE (MenuButton Subs contain 'Try' statements)
''' </remarks>
'''==============================================================================================
Public Function GetMenuItem(_profileOfSession As SessionProfile) As MenuButton() Implements IPluginMenuExtender.GetMenuItem
'Throw New NotImplementedException() 'Generated by Default; Comment out/delete for plugin to execute
'「Ctrl」+「%」 :: Boolean XOR (Exclusive or)
Dim btnKeyPress01 As SMath.Controls.MenuButton
btnKeyPress01 = New MenuButton("Boolean XOR", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("¤", SMath.Manager.TermType.Operator, 2))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("¤"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress01.ShortcutKey = InputKeys.Control Or InputKeys.Shift Or InputKeys.D5
'「Ctrl」+「!」 :: Boolean NOT
Dim btnKeyPress02 As SMath.Controls.MenuButton
btnKeyPress02 = New MenuButton("Boolean NOT", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("¬", SMath.Manager.TermType.Operator, 1))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("¬"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress02.ShortcutKey = InputKeys.Control Or InputKeys.Shift Or InputKeys.D1
'「Ctrl」+「-」 :: Insert a Macron (bar) Above the Previous Character
Dim btnKeyPress03 As SMath.Controls.MenuButton
btnKeyPress03 = New MenuButton("Macron Above (x̅)", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
'do nothing!
Else
_args.CurrentRegion.OnCommandSend("̅"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress03.ShortcutKey = InputKeys.Control Or InputKeys.OemMinus
'「Ctrl」+「_」 :: Insert a Macron Below (undlerline) Above Previous Character
Dim btnKeyPress04 As SMath.Controls.MenuButton
btnKeyPress04 = New MenuButton("Macron Below (x̲)", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
'do nothing!
Else
_args.CurrentRegion.OnCommandSend("̲"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress04.ShortcutKey = InputKeys.Control Or InputKeys.Shift Or InputKeys.OemMinus
'「Ctrl」+「+」numpad :: Plus Minus Sign (Returns a set of 2: the sum And difference)
Dim btnKeyPress05 As SMath.Controls.MenuButton
btnKeyPress05 = New MenuButton("Plus Minus (±
", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("±", SMath.Manager.TermType.Operator, 1))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("±"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress05.ShortcutKey = InputKeys.Control Or InputKeys.Add
'「Ctrl」+「-」numpad :: Minus Plus Sign (Returns a set of 2: the difference And sum)
Dim btnKeyPress06 As SMath.Controls.MenuButton
btnKeyPress06 = New MenuButton("Minus Plus (∓)", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("∓", SMath.Manager.TermType.Operator, 1))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("∓"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress06.ShortcutKey = InputKeys.Control Or InputKeys.Subtract
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'Supported in Later Versions (v1.00+) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'
'「Ctrl」+「~」 :: Approximately Equal to (「Ctrl」+「Alt」+「=」)
Dim btnKeyPress07 As SMath.Controls.MenuButton
btnKeyPress07 = New MenuButton("Approx. Equal (≈)", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("≈", SMath.Manager.TermType.Operator, 2))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("≈"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress07.ShortcutKey = InputKeys.Control Or InputKeys.Oemtilde
'「Ctrl」+「Shift」+「~」 :: Approximately NOT Equal to
Dim btnKeyPress08 As SMath.Controls.MenuButton
btnKeyPress08 = New MenuButton("Approx. NOT Equal (≉)", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("≉", SMath.Manager.TermType.Operator, 2))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("≉"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress08.ShortcutKey = InputKeys.Control Or InputKeys.Shift Or InputKeys.Oemtilde
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'Functions (not operators) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'「Ctrl」+「;」 :: Range variable [a .. b] (step = 1)
Dim btnKeyPress09 As SMath.Controls.MenuButton
btnKeyPress09 = New MenuButton("Insert range ( ▮..▮ )", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("range", SMath.Manager.TermType.Function, 2))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("range(,"
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress09.ShortcutKey = InputKeys.Control Or InputKeys.OemSemicolon
'「Ctrl」+「4」 :: Vector sum
Dim btnKeyPress10 As SMath.Controls.MenuButton
btnKeyPress10 = New MenuButton("Insert Summation ( Σ ▮ )", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
Dim Bénézet As SMath.Controls.MathRegion = New SMath.Controls.MathRegion(_args.SessionProfile)
Dim Rhône = New List(Of SMath.Manager.Term)
Rhône.Add(New SMath.Manager.Term("#", SMath.Manager.TermType.Operand, 0))
Rhône.Add(New SMath.Manager.Term("sum", SMath.Manager.TermType.Function, 1))
Bénézet.Terms = Rhône.ToArray
Dim Avignon As SMath.Controls.RegionsEnumerator = New SMath.Controls.RegionsEnumerator(New List(Of SMath.Controls.RegionBase)({Bénézet}), 0)
_args.Worksheet.CreateRegions(Avignon, 0, 0, , )
Else
_args.CurrentRegion.OnCommandSend("sum("
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress10.ShortcutKey = InputKeys.Control Or InputKeys.D4
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'Navigation (move Document Pointer (Crosshair Cursor)) \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
'「Ctrl」+「Shift」+「Enter」 :: Move ✛ to Start of Next Line (Line Feed & Carriage Return Only) "Ignore Region Interaction" Mode --- DocumentPointer - Line Feed [↩]
Dim btnKeyPress11 As SMath.Controls.MenuButton
btnKeyPress11 = New MenuButton("DocumentPointer - Line Feed [↩]", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(5, _args.Worksheet.Pointer.Location.Y + CURSOR_STEP))
Else
_args.Worksheet.UnfocusRegions()
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(5, _args.Worksheet.Pointer.Location.Y + _args.CurrentRegion.Size.Height + CURSOR_STEP))
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress11.ShortcutKey = InputKeys.Control Or InputKeys.Shift Or InputKeys.Return
'「Ctrl」+[↓] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [↓]
Dim btnKeyPress12 As SMath.Controls.MenuButton
btnKeyPress12 = New MenuButton("DocumentPointer [↓]", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X,
_args.Worksheet.Pointer.Location.Y + CURSOR_STEP))
Else
_args.Worksheet.UnfocusRegions()
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X,
_args.Worksheet.Pointer.Location.Y + _args.CurrentRegion.Size.Height + CURSOR_STEP))
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress12.ShortcutKey = InputKeys.Control Or InputKeys.Down
'「Ctrl」+[←] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [←]
Dim btnKeyPress13 As SMath.Controls.MenuButton
btnKeyPress13 = New MenuButton("DocumentPointer [←]", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X - CURSOR_STEP,
_args.Worksheet.Pointer.Location.Y))
Else
_args.Worksheet.UnfocusRegions()
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X - CURSOR_STEP,
_args.Worksheet.Pointer.Location.Y + _args.CurrentRegion.Size.Height / 2))
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress13.ShortcutKey = InputKeys.Control Or InputKeys.Left
'「Ctrl」+[→] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [→]
Dim btnKeyPress14 As SMath.Controls.MenuButton
btnKeyPress14 = New MenuButton("DocumentPointer [→]", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X + CURSOR_STEP,
_args.Worksheet.Pointer.Location.Y))
Else
_args.Worksheet.UnfocusRegions()
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X + _args.CurrentRegion.Size.Width + CURSOR_STEP,
_args.Worksheet.Pointer.Location.Y + _args.CurrentRegion.Size.Height / 2))
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress14.ShortcutKey = InputKeys.Control Or InputKeys.Right
'「Ctrl」+[↑] :: Enter "Ignore Region Interaction" Mode --- DocumentPointer [↑]
Dim btnKeyPress15 As SMath.Controls.MenuButton
btnKeyPress15 = New MenuButton("DocumentPointer [↑]", Sub(_args As MenuButtonArgs)
Try
If IsNothing(_args.CurrentRegion) Then
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X,
_args.Worksheet.Pointer.Location.Y - CURSOR_STEP))
Else
_args.Worksheet.UnfocusRegions()
_args.Worksheet.Pointer.SetLocation(New Drawing.Point(_args.Worksheet.Pointer.Location.X,
_args.Worksheet.Pointer.Location.Y - CURSOR_STEP))
End If
Catch
'do nothing!
End Try
End Sub) : btnKeyPress15.ShortcutKey = InputKeys.Control Or InputKeys.Up
'Proof of Concept: Assign [F1]
Dim btnKeyPressHelp = New MenuButton("Help / About", Sub(_args As MenuButtonArgs)
MsgBox("======================================" & vbCrLf &
"name: GetMenuItem" & vbCrLf &
"author: Kenneth M. Lemens (username: lemensk)" & vbCrLf &
"date: 2022-12-15" & vbCrLf &
"type: IPluginMenuExtender" & vbCrLf &
"summary:Adds MenuButtons to the Menu Bar (w/ hotkeys):" & vbCrLf &
" Hotkeys work within region, or creates a new region" & vbCrLf &
"https://en.smath.com/forum/Default.aspx?g=posts&t=23271" & vbCrLf & vbCrLf &
" || MENU BAR BUTTON LAYOUT ||" & vbCrLf &
" [Tools]" & vbCrLf &
" [Keyboard Extension]" & vbCrLf &
" - 「Ctrl」+「%」 - ▮⊕▮ Boolean XOR (Exclusive or) " & vbCrLf &
" - 「Ctrl」+「!」 - ¬▮ Boolean NOT" & vbCrLf &
" - 「Ctrl」+「-」 - x̅ Insert a Macron Above" & vbCrLf &
" - 「Ctrl」+「_」 - x̲ Insert a Macron Below" & vbCrLf &
" - 「Ctrl」+「+」numpad - ±▮; ▮±▮ Plus Minus Sign" & vbCrLf &
" - 「Ctrl」+「-」numpad - ∓▮; ▮∓▮ Minus Plus Sign" & vbCrLf &
" - 「Ctrl」+「~」 - ▮≈▮ Approx. Equal to (「Ctrl」+「Alt」+「=」)" & vbCrLf &
" - 「Ctrl」+「Shift」+「~」 - ▮≉▮ Approx. NOT Equal to" & vbCrLf &
" - 「Ctrl」+「;」 - ▮..▮ Range Function" & vbCrLf &
" - 「Ctrl」+「4」 - Σ▮ Vector Sum" & vbCrLf &
" - 「Ctrl」+「Shift」+「Enter」 - Move ✛ to Start of Next Line" & vbCrLf &
" - 「Ctrl」+Arrows - Ignore Regions when moving cursor" & vbCrLf &
"======================================" & vbCrLf & vbCrLf &
"Press [Ctrl]+[C] to Copy this message to your clipboard...", vbOKOnly & vbInformation, "[Tools]→[Keyboard Extension] (by lemensk)"
End Sub) : btnKeyPressHelp.ShortcutKey = InputKeys.F1
Dim btnKeyboardMenu = (New MenuButton("Keyboard Extension"
)
With btnKeyboardMenu
.Location = MenuButtonLocation.ToolsMenu
.AppendChild(btnKeyPress01)
.AppendChild(btnKeyPress02)
.AppendChild(btnKeyPress03)
.AppendChild(btnKeyPress04)
.AppendChild(btnKeyPress05)
.AppendChild(btnKeyPress06)
.AppendChild(btnKeyPress07)
.AppendChild(btnKeyPress08)
.AppendChild(btnKeyPress09)
.AppendChild(btnKeyPress10)
.AppendChild(btnKeyPress11)
.AppendChild(btnKeyPress12)
.AppendChild(btnKeyPress13)
.AppendChild(btnKeyPress14)
.AppendChild(btnKeyPress15)
.AppendChild(btnKeyPressHelp)
End With
Return (New MenuButton() {btnKeyboardMenu})
End Function
' ========================================================================================================
' \\\\ GENERATED SUBS //// ===============================================================================
' ========================================================================================================
Protected Overridable Sub Dispose(disposing As Boolean)
If Not disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects)
End If
' TODO: free unmanaged resources (unmanaged objects) and override finalizer
' TODO: set large fields to null
disposedValue = True
End If
End Sub
' ' TODO: override finalizer only if 'Dispose(disposing As Boolean)' has code to free unmanaged resources
' Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
' Dispose(disposing:=False)
' MyBase.Finalize()
' End Sub
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in 'Dispose(disposing As Boolean)' method
Dispose(disposing:=True)
GC.SuppressFinalize(Me)
End Sub
End Class
Preview:
---------------------------
[Tools]→[Keyboard Extension] (by lemensk)
---------------------------
======================================
name: GetMenuItem
author: Kenneth M. Lemens (username: lemensk)
date: 2022-12-15
type: IPluginMenuExtender
summary:Adds MenuButtons to the Menu Bar (w/ hotkeys):
Hotkeys work within region, or creates a new region
https://en.smath.com/forum/Default.aspx?g=posts&t=23271
|| MENU BAR BUTTON LAYOUT ||
[Tools]
[Keyboard Extension]
- 「Ctrl」+「%」 - ▮⊕▮ Boolean XOR (Exclusive or)
- 「Ctrl」+「!」 - ¬▮ Boolean NOT
- 「Ctrl」+「-」 - x̅ Insert a Macron Above
- 「Ctrl」+「_」 - x̲ Insert a Macron Below
- 「Ctrl」+「+」numpad - ±▮; ▮±▮ Plus Minus Sign
- 「Ctrl」+「-」numpad - ∓▮; ▮∓▮ Minus Plus Sign
- 「Ctrl」+「~」 - ▮≈▮ Approx. Equal to (「Ctrl」+「Alt」+「=」)
- 「Ctrl」+「Shift」+「~」 - ▮≉▮ Approx. NOT Equal to
- 「Ctrl」+「;」 - ▮..▮ Range Function
- 「Ctrl」+「4」 - Σ▮ Vector Sum
- 「Ctrl」+「Shift」+「Enter」 - Move ✛ to Start of Next Line
- 「Ctrl」+Arrows - Ignore Regions when moving cursor
======================================
Press [Ctrl]+[C] to Copy this message to your clipboard...
---------------------------
OK
---------------------------
Q: ) Will you be deploying this as a SMath Extension?
A: ) No, I do not plan to. As to why, the reason is simple: I do not know how this plugin will behave across different languages/keyboard configurations/operating systems. Before I could release a plugin I am proud of, I would need to address the implications that will result from these different configurations. In addition, such a plugin would beg the developer to permit users to customize key bindings to any given action; I do not have the time to develop such a great utility. Finally: such a plugin has the dangers of being greedy; I would not be able to guarantee such a plugin to respect (either by yielding or overtaking) keystrokes reserved by any given plugin.
Q: ) Why is this code written in Visual Basic and not C++
A: ) VB.net is not the better language, but rather I cannot ignore the benefits of VB within my profession. It is easy to read, less prone to make syntax errors, has a large range of implementations from VBScript in Mathcad, to VBA in MSOffice, from VB6 to VB.net in VSTO/Desktop applications. With that being said, I will not be posting the C++ equivalent as I am not proficient in doing so; I apologize for the inconvenience.
With that being said, here are some of my 'lessons learned' during my research:
- These shortcut key commands must utilize Modifier keys; exceptions will be thrown if a shortcut is specified with a single keystroke (ie., you cannot bind 「;」, but you can bind 「Ctrl」+「;」). An exception to this rule may be the F1-F12 keys.
- Depending if a region is selected, a keypress will need to be handled differently to achieve the desired results. The code provided above will try to create a new region if nothing is selected; else it will send an action into the current region.
- All Menu Buttons are NOT created equal! While I did not explore this in earnest, I did observe that the shortcut keys bound to context menu buttons will not work unless the context menu is expanded. In addition, shortcut keys bound to menu buttons within the INSERT menu will not execute if a region is selected (that is this, for these keybindings to work, the developer must utilize IPluginMenuExtender as IPluginCustomRegion can only influence the INSERT menu)
- These shortcut keys need not to be limited to inserting Mathematical operators! You will notice I developed keybindings so that the Document Pointer (✛) can be moved via keyboard without entering a region. This is huge as navigation solely by the keyboard is nigh impractical.
May this be of Good Help, Merry Christmas;
- Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1 пользователям понравился этот пост
overlord 15.12.2022 18:12:00
#6 Опубликовано: 16.12.2022 12:07:51
Greetings,
Just so everybody is aware, several posts were just deleted by the Administrator, most of which were off topic and had no correlation to keyboards/keybindings. However, one post did contained profanity.
As such, I want to encourage users to report posts if they have no relevance to the topic at hand; the Administrator has the discretion to transfer/edit/delete depending on the complaint/merits. To report a post (and provide a description of your complaint), use the [🚩 REPORT] Button in the bottom right of any post.
For the record, below are the contents of the post(s) that were purged from this thread:
Thank you,
- Kenny Lemens, P.E. ᵂᴵ
Just so everybody is aware, several posts were just deleted by the Administrator, most of which were off topic and had no correlation to keyboards/keybindings. However, one post did contained profanity.
As such, I want to encourage users to report posts if they have no relevance to the topic at hand; the Administrator has the discretion to transfer/edit/delete depending on the complaint/merits. To report a post (and provide a description of your complaint), use the [🚩 REPORT] Button in the bottom right of any post.
For the record, below are the contents of the post(s) that were purged from this thread:
Image of Forum before posts were deleted: https://web.archive.org/web/20221216141943/https://en.smath.com/forum/yaf_postsm79999_SMath-Keyboard-Shortcuts.aspx
More Profanity:
https://web.archive.org/web/20221216192621/https://en.smath.com/forum/yaf_postst23271_SMath-Keyboard-Shortcuts.aspx
Screen capture:
WroteYou [i.e., overlord] wrote you were happy from my Samples.
mostly filled with ####
Smath Community will benefit you direct to ####.
... as well as Web Maters.
By same token: your Fibonacci is #### !
More Profanity:
WroteCan it be that it ***** Smath document description & text region ?
It made my Binet description kaput.
Close Smath, restart ... back to normal.
https://web.archive.org/web/20221216192621/https://en.smath.com/forum/yaf_postst23271_SMath-Keyboard-Shortcuts.aspx
Screen capture:
Thank you,
- Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
2 пользователям понравился этот пост
1 страниц (6 вхождений)
-
Новые сообщения
-
Нет новых сообщений