Visual Studio keymap (for debugger and compiller) lazarus / 12-Debugger ---------------------------------------------------------------------- Tango600 · 2022-06-13 07:44 If I create Visual Studio keymap, how I publish this& ---------------------------------------------------------------------- MarkMLl · 2022-06-13 07:59 Are you saying that you've produced a keymap for Lazarus? If so I'd suggest discussing it here with a particular focus on what OSes etc. you've tested it with. Then submit is as a bug report (see link in left-hand column). If OTOH you're discussing a keymap for Visual Studio it's not relevant to this forum. MarkMLl ---------------------------------------------------------------------- marcov · 2022-06-13 08:06 Quote from: MarkMLl on June 13, 2022, 09:59:10 amIf OTOH you're discussing a keymap for Visual Studio it's not relevant to this forum. If it is to put FPC under an other IDE like VS/VSCode, it is relevant, but should be moved to FPC subforums (not lazarus subforum). The short answer is probably: put it on github/gitlab or any other form of free hosting. ---------------------------------------------------------------------- MarkMLl · 2022-06-13 10:28 Quote from: marcov on June 13, 2022, 10:06:02 amIf it is to put FPC under an other IDE like VS/VSCode, it is relevant, but should be moved to FPC subforums (not lazarus subforum). Yes, true. At this point however I'd note that the Lazarus IDE stands comparison with VSCode, and is superior (in my opinion) to Eclipse. It's a pity that it doesn't support more languages, possibly via something like the Language Server Protocol (noting e.g. the thread at https://www.mail-archive.com/fpc- pascal@lists.freepascal.org/msg52619.html). MarkMLl ---------------------------------------------------------------------- Martin_fr · 2022-06-13 11:35 Quote from: Tango600 on June 13, 2022, 09:44:39 amIf I create Visual Studio keymap, how I publish this& You mean you went to menu: Tools > Options > Editor > Keymap? Unfortunately the IDE does not have an Export or Import function for those settings. You can find the changes you made in the "EditorOptions.xml" file, in your "primary config path". The "primary config path" can be found in menu View > Ide Internals > About IDE. It defaults to: C:\Users\\AppData\Local\lazarus or on Linux to ~/.lazarus The XML in that file has a "" section. So to make your changes available: - you open that file, and copy that section. Then publish that XML. - Users who want to use it can (while the IDE is closed) edit their "EditorOptions.xml". However, your changes will be based on one of the default schemes. Either: - Lazarus Default - Classic - MacOs Apple style - MacOs Lazarus style The Mac schemes will have different mappings for the modifier keys. E.g. "Ctrl-c" will be "Command-C"  (IIRC). Your changes are relative to your selected scheme. (only the diff is saved). So it may (at least partly) work with other schemes. But likely will need some work for them. Of course - if for example you are NOT a Mac user - then everyone importing your scheme, if they too are not Mac users, can use the same base-scheme. But not all Mac-Users wont be happy using a non-Mac base scheme. Still they can adapt it.... It would be nice, if someone could contribute Export/Import of keymaps.... ---------------------------------------------------------------------- Tango600 · 2022-06-13 17:47 Quote from: marcov on June 13, 2022, 10:06:02 am... should be moved to FPC subforums (not lazarus subforum). Why, it is a Lazarus editor keymap. ---------------------------------------------------------------------- Tango600 · 2022-06-13 17:50 note: Keymaps is hardcoded in "C:\lazarus\ide\keymapping.pp" ---------------------------------------------------------------------- Tango600 · 2022-06-13 17:58 Note: Flashback note: I have installed many IDE on my PC. All IDEs have one keymap, except Lazarus. ---------------------------------------------------------------------- skalogryz · 2022-06-13 19:47 Quote from: Martin_fr on June 13, 2022, 01:35:32 pmIt would be nice, if someone could contribute Export/Import of keymaps.... maybe, I could do that! it has been my long time struggle xD ---------------------------------------------------------------------- Martin_fr · 2022-06-13 20:12 Quote from: skalogryz on June 13, 2022, 09:47:22 pmQuote from: Martin_fr on June 13, 2022, 01:35:32 pmIt would be nice, if someone could contribute Export/Import of keymaps.... maybe, I could do that! it has been my long time struggle xD I'd be happy to assist if you have questions... There is a similar feature for Colors and Advanced-Mouse-Config already. The big question is, if an exported keymap should be - a diff to one of the predefined sets. (That could over time cause issues, if the predefined set changes) - a full export - either of those - user can choose during export. ---------------------------------------------------------------------- Martin_fr · 2022-06-13 20:13 Quote from: Tango600 on June 13, 2022, 07:50:47 pmnote: Keymaps is hardcoded in "C:\lazarus\ide\keymapping.pp" So you edited your copy of keymapping.pp ? ---------------------------------------------------------------------- skalogryz · 2022-06-14 17:36 Here you go: https://github.com/skalogryz/Lazarus/commit/48eb5a1066438 e93268d68486ec66bb9648b4eec I don't really like the produced export file (which is based on the configuration). It's not really human editable, but from IDE to IDE it should work just fine and it's future changes friendly already! So maybe, the human-readable and editable format could be added alter. todo: check if there're any "standards" in the keymapping world (similar to .editorconfig) Quote from: Martin_fr on June 13, 2022, 10:12:52 pmThe big question is, if an exported keymap should be - a diff to one of the predefined sets. (That could over time cause issues, if the predefined set changes) - a full export - either of those - user can choose during export. What is "diff"? i think it's something that only IDE itself could use of, since it's aware of what is considered "default". When brining the set of keys from one configuration to another, the "default" for source and destination systems can be different. Thus the concept of "diff" makes no sense. Just like any other application - the full export for the actual IDE version. (It's understood that commands could be added and removed between Lazarus versions). upd Quote from: Martin_fr on June 13, 2022, 10:12:52 pmThere is a similar feature for Colors and Advanced-Mouse-Config already. For Colors I can only see "Export"... should there be an import too? Looking through the Options frames, it appears to me that IDE needs some sort of guildelines on how to design those. upd2 With the Import/Export in place, it should now be easier to get rid of hard-coded schemas and keep them external. ---------------------------------------------------------------------- MarkMLl · 2022-06-14 21:49 Quote from: skalogryz on June 14, 2022, 07:36:02 pmtodo: check if there're any "standards" in the keymapping world (similar to .editorconfig) Not to the best of my knowledge. However if you've got access to a Linux system I'd point you at evtest and related info (which broadly speaking gives you a list of input devices- keyboard and other- and what they emit), and also at the mxk utility hence tangentially https://wiki.freepascal.org/Lazarus_IDE_with_Nostromo_Keypad_on_Linux for an example of what it can be used for. QuoteWhat is "diff"? i think it's something that only IDE itself could use of, since it's aware of what is considered "default". When brining the set of keys from one configuration to another, the "default" for source and destination systems can be different. Thus the concept of "diff" makes no sense. It makes a lot of sense, and is what Termcap etc. uses. Start off with some fairly standard mapping, and then have a brief list of how the current settings depart from it. MarkMLl ---------------------------------------------------------------------- skalogryz · 2022-06-15 03:38 Quote from: MarkMLl on June 14, 2022, 11:49:57 pmStart off with some fairly standard mapping, and then have a brief list of how the current settings depart from it. and which mapping is standard for Larazus IDE? is it standard for all operating systems Lazarus runs on? ---------------------------------------------------------------------- MarkMLl · 2022-06-15 06:52 Quote from: skalogryz on June 15, 2022, 05:38:43 amQuote from: MarkMLl on June 14, 2022, 11:49:57 pmStart off with some fairly standard mapping, and then have a brief list of how the current settings depart from it. and which mapping is standard for Larazus IDE? is it standard for all operating systems Lazarus runs on? Not really relevant to the point that I think Martin's making. Start off with /something/ and give it a name, then publish modifications indicating what the named base is. The base could actually be a null mapping (i.e. the diff is actually a complete map), or a diff might be appropriate for multiple bases. That would accommodate the case where e.g. I find I have to change just one mapping to avoid a clash with a KDE hotkey. As I said, that's the way that termcap etc. have always worked on unix for output terminal control sequences, so there's precedent. MarkMLl ---------------------------------------------------------------------- Tango600 · 2022-06-17 11:40 Quote from: Martin_fr on June 13, 2022, 10:13:45 pmSo you edited your copy of keymapping.pp ? I did it. And I created issue. https://gitlab.com/freepascal.org/lazarus/lazarus/- /issues/39798#note_994415230 ---------------------------------------------------------------------- skalogryz · 2022-06-18 17:44 for the discussion. Does it worth to modify loading XML process, thus it could understand characters, instead of integer codes for keys. So instead of Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                it would be possible to write: Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                (and if the actual number needs to be specified, it could be prefixed by some character) Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                (which would map to key "6") Obviously, it's also possible to use a different attribute, i.e. Char1 (instead of Key1), BUT it also introduces a problem which one to use, if both are specified. Purpose: to make the configuration of the key mapping files HUMAN friendly. Btw, Visual Studio keyboard map XML is attached. It is based on Tango600's keyboard schema. ---------------------------------------------------------------------- Martin_fr · 2022-06-18 18:11 Quote from: skalogryz on June 18, 2022, 07:44:53 pmfor the discussion. Does it worth to modify loading XML process, thus it could understand characters, instead of integer codes for keys. That is an interesting question... I think in most cases the actual key, is more important. IIRC by default Ctrl+/  comments the current line/selection. Never mind which Keycode the "/" has on the users keyboard layout. For example, I use "Dovrak UK Punctuation". The IDE has Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   ecToggleComment:       SetSingle(VK_OEM_2,[XCtrl]);which did not work for me at all. Having "ctrl" and "key=/" instead of a keycode, could help... or could mess it up. On a German layout the "\" is only available via AltGr. Yet on an English layout the "\" has its own key. Having something like ctrl-\  would then break, if a German user wants to load it. Quote(and if the actual number needs to be specified, it could be prefixed by some character) Actually, in that case the XML could have a "KeyCode"             QuoteBtw, Visual Studio keyboard map XML is attached. It is based on Tango600's keyboard schema. It will be a little time before I get to any of this. Quite busy right now. I do think that the V.S. map is a great extension. As for XML vs Build-in, I will wait what other devs have to say. ---------------------------------------------------------------------- skalogryz · 2022-06-18 20:31 Quote from: Martin_fr on June 18, 2022, 08:11:08 pmIIRC by default Ctrl+/  comments the current line/selection. Never mind which Keycode the "/" has on the users keyboard layout. I see what you mean. Indeed layouts have different characters per same keycode. Yet, if we define that characters are treated as US-layout characters and in the end are mapped to the corresponding key codes, this would be sufficient. In the end, xml is to be human-friendly for the creator of such XML, not for the end-user. For the end user the selection takes place through the UI only (and the contents of XML is not review). Since you've brought that up. How does this Key Edit dialog works: There's a list of textual representation of keys (not just characters) How does it map back to the key code? Does it respect the current layout, or is it fixed to a certain (US) layout? ---------------------------------------------------------------------- Martin_fr · 2022-06-19 09:23 I don't know what the dialog uses. What we could use are the VK_### names: VK_A, VK_OEM. Sadly, it seems we don't (yet? ) have an IdentToInt for them. See components\ideintf\idecommands.pas   function IdentToIDECommand(const Ident: string; var Cmd: longint): boolean;   function IDECommandToIdent(Cmd: longint; var Ident: string): boolean; ---------------------------------------------------------------------- skalogryz · 2022-06-19 19:24 There are changes available: https://github.com/skalogryz/Lazarus/tree/keybordschemas The branch introduces loading of the custom keyboard schemas. I did put the description here: https://github.com/skalogryz/Lazarus/w iki/keybordschemas#Keyboard_Schema_Files Now, it's possible to extend pre-defined schemas without changing the code and distribute them with Lazarus. (i didn't update any installers though) Quote from: Martin_fr on June 19, 2022, 11:23:14 amI don't know what the dialog uses. it's based of KeyAndShiftStateToKeyString (at LCLProc) (KeyCodeStrings array) and there's a corresponding TextToShortCut() function to convert text to a code and it's obviously fixed to a certain keyboard layout. ---------------------------------------------------------------------- AlexTP · 2022-06-20 08:41 QuoteI did put the description here: https://github.com/skalogryz/Laza rus/wiki/keybordschemas#Keyboard_Schema_FilesIt should be put to Lazarus Wiki. Should I do it? ---------------------------------------------------------------------- PascalDragon · 2022-06-20 11:32 Quote from: AlexTP on June 20, 2022, 10:41:47 amQuoteI did put the description here: https://github.com/skalogryz/Lazarus/wiki/keybordsch emas#Keyboard_Schema_FilesIt should be put to Lazarus Wiki. Should I do it? Why would you want to add this if the corresponding isn't yet part of Lazarus' main? ---------------------------------------------------------------------- skalogryz · 2022-07-06 18:59 a couple of commits: https://github.com/skalogryz/Lazarus/commit/c5f80390b08a47fce8af7b6ebb 39757167e3c5ed (human readable export) https://github.com/skalogryz/Lazarus/commit/99f54ec041414ae3050938ecc2 d79193bc14c18e (file dialog filters) The major change is; - export is now generates human-readable file - import supports human-readable values, yet the original "decimals" values are supported (backwards compatible) - the entire list of shortcuts is exported (for "Export" feature), no matter if the key has an assigned  value or not As a result, this should make the list of shortcuts be easily readable and editable. Code: XML  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i                   ---------------------------------------------------------------------- skalogryz · 2022-07-11 13:36 conflict resolving commit https://github.com/fpc/Lazarus/commit/5f05ba32d10d75dce044a9fb30a2203e 62f7d05e