BasEdit.NET

You need an actual VIC.

Moderator: Moderators

maraud
Vic 20 Newbie
Posts: 3
Joined: Wed Feb 16, 2011 2:49 pm

Post by maraud »

I recently ran across this tool which I think is amazing for the record. I love the color tagging. I've used it so far for VIC and 64 stuff and that seems to work fine. However I did try last night to do a 128 program (switching the tokenizer to V7) and it shows everything but gets numerous errors when I try to save it. From what I've been able to ascertain it's related to the ASCII tokenizer setting. Any pointers on the correct setup for editing BASIC 7 files?
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

You only have to select the appropriate basic file (Options / Change basic version - TokenList_BasicV7.txt) and it *should* work fine. But to be honest I never tested more than Basic V2 and WimBasic extensively.

A short test at least revealed no errors for me when saving, but I do not know the correct syntax for the Basic V7 commands and don't know if the saved file will actually work on a C128 (real or Vice).

For the syntax check option (Edit / Syntax check) you should enhance the commands in TokenList_BasicV7.txt like the TokenList_BasicV2.txt - see header of that file for a description or copy and paste the needed parts :D
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Awesome :)

Post by Gurce »

Wow, this is an awesome tool :) I was looking for an editor for my 11 year old nephew to use to learn c64 basic programming and stumbled onto this this.

Great stuff, amazing that your kept this project going for 2 years now? :)

Perhaps some feedback I'm imagining will come when my nephew uses it is, "Why doesn't it work more like MS Notepad?".

Eg:
- Selecting text via mouse-click + drag
- Cut/copy/paste via ctrl+x/c/v
- Search via CTRL+F
- Standard windows text selection shortcuts:
- ctrl+shift+left/right to select word-by-word
- home, shift+end to select a line

Currently, I'm running it from Linux-mono, working fine, I was able to hook it up to ccs64 emulator too via your ini file.

Some gripes I've noticed (they 'might' be linux-specific, not sure, haven't tried the app in real windows yet):
- On a large program (eg, I opened your 'videopoker.prg') When I Ctrl+End to go to end of document, the last few lines of the document are below the bottom-edge of the screen. I have to drag the bottom-edge of the screen further down to see them.
- Using Alt+Arrows/1,2,3...9,0 for the special characters within strings has the quirk of once you've finished with the alt-key, it highlights the 'File' menu-item, so find myself having to press Alt again to bring focus back onto editing area.

Minor things, but thought they were worth a mention. Anyway, awesome work, congrats on your perseverance with this project :)[/list]
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

English keyboard mapping

Post by Gurce »

Also, is there an English keyboard mapping available yet? I think my nephew will get very frustrated figuring out the keys.

If anyone has made one already, great, can it be shared and made part of the install package?

If there isn't one made yet, I will give it a try now, am trying to get familiar with the "KeyMap_German.txt" file, and will try share a "KeyMap_English.txt" file when I'm done.

PS. Any chance you could give me some pointers on the keymap file-format?
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

probs creating mapping

Post by Gurce »

My initial efforts to figure this out on my own have been frustrating. Regardless of whatever edit I make, it seems to get ignored and just defaults to its own behaviour.

I've edited the "BasEdit.ini" file with:

' Mapping file for keystrokes
KeyMap=KeyMap_English.txt

My gut-feeling tells me the format of the file is as follows:

PETSCII-code comma shiftstate = pc/windows keycode?

One example modification I tried:

' first row - number keys
95, 0= "`" (hoping to turn this windows ` key into the c64's left-arrow char

The original line in "KeyMap_German.txt" is:
220, 0= "^"

But despite my change, upon restart, I still don't get the character I want when I press the windows ` key :(

Help, anyone, please? :)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Hi Gurce,

thanks for your feedback.

Standard windows editing keys unfortunately collide with the keymap, as ctrl-key and shift-key try to emulate the key behaviour of original VIC/C64 to generate graphics chars, chnage color codes etc.

For the keymap thingy I have to have a look to the sources, it's a long time since I last worked with/on BasEdit.
My first thought about the ´ key is that it won't work because it's a special key which is used for accented characters, i.e. é, á etc. and is not treated like normal chars for the keypress-event :-(
Did you check any other key, for example trying to chnage the a-key to something different, just to check whether your keymap-file is really read?

And I'm almost sure anyone made an english keymap - at least I only created the loadable keymap files on request :-)
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Post by Gurce »

Hi Schlowski,

Thanks for furthers details.

Another mod I tried is

FROM:
48, 0= "0"
49, 0= "1"

TO:
49, 0= "0"
48, 0= "1"

To try swap the 0 and 1 keys. This mod got ignored too, so I'm suspecting it is not reading the file. Perhaps the app execution path is a bit muddled when running from Linux and the app can't find this file... Not sure, will try run it from pure windows and see what happens.

Aah yes, I edit this file in Windows and it works. Ok then, so it had problems finding the path of this file in Linux. No worries, my nephew uses windows, so not too worried about Linux then.

Oh wait, my Linux problems were due to unzipping and running from a normal linux folder. I was able to fix the problem as follows:
  • move the unzipped app into wine's virtual drive-c folder, eg: "~/.wine/drive_c/BasEdit.net/" folder.
  • Run it with: wine "C:\\BasEdit.net\\BasEdit.exe"
And now the keymapping file is getting read (1 and 0 keys got swapped, as in example above).

Although I did notice another thing, it was very slow to start-up in Linux (perhaps about 20 seconds), but very fast in windows (instant). No big problem, just observation.

Ok thanks again, I think I will enjoy playing with this this weekend, and will post my english-mapping here soon :)
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Post by Gurce »

Aah, I was able to swap 0 and 1 keys, but still wasn't able to allocate the c64's '<-' left arrow char to *any* key. I tried allocating it to the '0' key as follows:

95, 0= "0"

But upon starting the app, it just ignores it and draws '0' char...

Hmm... I've also tried swapping to german keyboard layout to try figure out how your german keys are equating to the petscii.

One example I'm trying to follow:

219, 0= "ß"

When I push the english key-position equating to 'ß' while in german-keyboard layout and while typing in your app, it currently displays the '-' c64 character.

Although when I check the petscii table here:
http://sta.c64.org/cbm64pet.html

219 equates to a '+' type graphical shape. So have I misunderstood the 219? Is it not the petscii code, is it something else?
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Post by Gurce »

Aah, ok, think I've figured it out: So for my initial attemp to convert windows-grave key '`' into c64 left arrow char, can be achieved as follows:

grave key = VK_OEM_3 = 0xC0 = 192
c64 left-arrow char = 95

So in the mapping ini file, have to do the following:

' first row - number keys
192, 0= 95

Also, making sure that no other mapping for this key exists within other parts of the file. In my case, this english key is on the 1st row, but on the german keyboard, I think it equates to the 3rd row, so for now, I'll comment out that usage as below:

' third row characters
...
' 192, 0= "["

Ok, think I'm getting the hang of it. My key-mapping will be for english and ccs64 emulator, as that's the one my nephew uses, will upload it sometime this weekend ;)
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

english keymap - ccs64 style

Post by Gurce »

Ok then, I've emailed Schlowski my English keymap file (ccs64-style).

The only variation from the ccs64 key-map are:
  • F11 = pound-sign key. I didn't want to allocate it to the INS key as in ccs64, as that would cripple the functionality of the editor (to toggle between insert/overwrite modes)
  • F12 = c64 '^' up-arrow graphic. I didn't want to allocate it to the DEL key as in ccs64, as that would again cripple the standard functionality within this editor (to delete characters to the right of the cursor).
Ok, I'm hoping Schlowski can either add it to the zip or share it in these forums somehow. Preferably the former, since I imagine many potential users downloading the app would like the english keymap, while ofcourse I know there are many German users that would prefer German keymap (perhaps more in number than English users too! :)).
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Thank you very much for your efforts, sorry for the confusion about the mappings. But finally you managed to figure it out, great!

I've got no mail from you until now, as soon as I get the file I will add it to the "official" zip :)

Edit: Found the eMail, will update the zip soon...
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Ok, updated the zip files with the new keymap file from Gurce, again many thanks for your effort!
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

Post by Gurce »

No probs, happy to contribute ;)

Also, with your permission, I've prepared a sourceforge.net project, in-case anyone is interested in developing your app further in their spare time.

https://sourceforge.net/projects/baseditnet

I'm not all too familiar with sourceforge.net, but I'm braving the learning curve today. There is now a Mercurial repository there, housing Björg's v1.4.2 code.

As a test of the repo, I'll give myself a pet-task of getting mouse-selection of text, will try to commit/push it, and see how it goes :)

As far as I understand, read/write access to the repository is now public, anyone can commit code to it if they make a sourceforge.net log-in account.

If anyone has any Q's about it, feel free to ask. I know only a little, but I'll try hunt down answers.
User avatar
Gurce
Vic 20 Drifter
Posts: 30
Joined: Wed Jul 18, 2012 10:37 pm

V1.4.3

Post by Gurce »

Ok then, here's v1.4.3, a minor improvement in mouse selection of text.

Available here:
https://sourceforge.net/projects/baseditnet/

It was more of an excuse to get acquainted with the code-base and get familiar with the sourceforge.net site.

Björg, not sure what you'll feel about the zip being hosted on the sourceforge site too, hope you're ok with it.

I've also been fairly verbose on the wiki and on the blog of the site, conveying a lot of my learning curve on installing/configuring VB.Net, interacting with Sourceforge. Hope that will help/encourage other developers to take a dip into these waters if they ever get the desire, but are put off by new learning curves.

Ok, maybe future pet-tasks I'll aim for can be more text-selection improvements:
  • shift+END key to select from current cursor pos to end of line
  • shift+HOME key to select from current cursor to the start of line
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Hi Gurce,

I'm very pleased with what you are doing, go ahead and improve BasEdit.
And yes, please host the ZIP file there, it's much easier to keep the updated version there than to update my zip file every time you change anything.

It's somehow strange to see anyone else working on "my" BasEdit, but I'm very happy that it is of use for others and will be improved.

I will dip into the whole sourceforge thing after the next week (very busy with work and international vistors), please feel free to do whatever you want, it's a free source :)
Post Reply