[VM][Unix][3.1a-4164pre1][Fix]Small problems

Torge Husfeldt jean-jacques.gelee at gmx.de
Sun Oct 7 02:08:00 UTC 2001


Hi VM-Hackers,
I encountert two little problems with my VM that I built from the above
mentioned sources.

1. (Forward) Delete was hardcoded to beheve like Backspace (in two
places) - I thought we had more or less convinced everyone that it is
much more flexible to map these keys on one in the image (maybe with a
Preference)?

2. The wheel mouse support didn't work. I can't really tell why but with
the changes you see in the diff at the bottom it works fine. Has anybody
else encountered these problems or can you tell me if your wheelmouse
works with my changes (or can you put my changes right because i think
this is a lousy hack)?

Thanks in advance,
Torge

root at linux:~/Squeak-3.1a-4164/src/unix > diff sqXWindow.c
/usr/src/packages/squeak/Squeak-3.1a-4164/src/unix/sqXWindow.c
883,884c883,884
<   if (charCode == 127)
<     charCode= 8;
---
> //  if (charCode == 127)
> //    charCode= 8;
1621,1622c1621,1622
<   if (charCode == 127)
<     charCode= 8;
---
> //  if (charCode == 127)
> //    charCode= 8;
1648a1649
>   int charCode= 0;
1656,1657c1657,1660
<     case 5: keyBufAppend( (theEvent->button + 26)        /* Up/Down */
<                      | (2 << 8)                          /* Ctrl  */
---
>     case 5: charCode= theEvent->button + 26;
>           modifiers= 2;
>           keyBufAppend( (theEvent->button + 26)        /* Up/Down */
>                      | (modifiers << 8)                /* Ctrl    */
1658a1662,1670
>          {
>             sqKeyboardEvent *evt= allocateKeyboardEvent();
>             evt->charCode= charCode;
>             evt->pressCode= EventKeyChar;
>             evt->modifiers= modifiers;
>             evt->reserved1=
>               evt->reserved2=
>               evt->reserved3= 0;
>           }
-------------- next part --------------
'From Squeak3.0 of 4 February 2001 [latest update: #3552] on 7 October 2001 at 4:06:42 am'!
"Change Set:		DelBackspaceFix
Date:			7 October 2001
Author:			Torge Husfeldt

Comes with a vm-fix so that the user can decide weather del and BS should behave the same without fiddling with the vm.
(only an issue on Unixes)"!


!ParagraphEditor methodsFor: 'typing/selecting keys' stamp: 'th 10/7/2001 04:04'!
forwardDelete: characterStream
	"Delete forward over the next character.
	  Make Undo work on the whole type-in, not just the one char.
	wod 11/3/1998: If there was a selection use #zapSelectionWith: rather than #backspace: which was 'one off' in deleting the selection. Handling of things like undo or typeIn area were not fully considered."
	| startIndex usel upara uinterval ind stopIndex |
	Preferences mapDeleteToBackspace ifTrue:[^self backspace:characterStream].
	startIndex _ startBlock stringIndex.
	startIndex > paragraph text size ifTrue:
		[sensor keyboard.
		^ false].
	startIndex = stopBlock stringIndex ifFalse:
		["there was a selection"
		sensor keyboard.
		self zapSelectionWith: self nullText.
		^ false].
	"Null selection - do the delete forward"
	beginTypeInBlock == nil	"no previous typing.  openTypeIn"
		ifTrue: [self openTypeIn. UndoSelection _ self nullText].
	uinterval _ UndoInterval deepCopy.
	"umes _ UndoMessage deepCopy.	Set already by openTypeIn"
	"usel _ UndoSelection deepCopy."
	upara _ UndoParagraph deepCopy.
	stopIndex := startIndex.
	(sensor keyboard asciiValue = 127 and: [sensor leftShiftDown])
		ifTrue: [stopIndex := (self nextWord: stopIndex) - 1].
	self selectFrom: startIndex to: stopIndex.
	self replaceSelectionWith: self nullText.
	self selectFrom: startIndex to: startIndex-1.
	UndoParagraph _ upara.  UndoInterval _ uinterval.
	UndoMessage selector == #noUndoer ifTrue: [
		(UndoSelection isText) ifTrue: [
			usel _ UndoSelection.
			ind _ startIndex. "UndoInterval startIndex"
			usel replaceFrom: usel size + 1 to: usel size with:
				(UndoParagraph text copyFrom: ind to: ind).
			UndoParagraph text replaceFrom: ind to: ind with:
self nullText]].
	^false! !

"Postscript:
Preferences addPreference: #mapDeleteToBackspace categories: #(general)
		default: false balloonHelp:  'Makes the Del key work like Backspace (look in vm if disabling doesn''t work)'."
!



More information about the Squeak-dev mailing list